如何在Visual Studio C++ Win32项目中填充组合框.如何检查用户选择了哪个单词.
我的意思是我想要一个充满这些的comboxbox:一,二,三.我想做不同的事件取决于用户选择哪一个.
编辑:窗口在资源编辑器中创建为对话框,消息线程运行如下:
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
return DialogBox(hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, DlgProc);
}
Run Code Online (Sandbox Code Playgroud)
先感谢您!
如何使用DirectInput模拟按键?我目前有初始化(但我不确定它是否好):
#include <dinput.h>
#pragma comment (lib, "dinput8.lib")
#pragma comment (lib, "dxguid.lib")
LPDIRECTINPUT8 din; // the pointer to our DirectInput interface
LPDIRECTINPUTDEVICE8 dinkeyboard; // the pointer to the keyboard device
BYTE keystate[256]; // the storage for the key-information
void initDInput(HINSTANCE hInstance, HWND hWnd); // sets up and initializes DirectInput
void detect_input(void); // gets the current input state
void cleanDInput(void); // closes DirectInput and releases memory
Run Code Online (Sandbox Code Playgroud)
那么有人可以告诉我如何模拟例如在游戏中按下左箭头键吗?
我的问题如下.我尝试将字符串转换为double.通过这种方式:
string str = "1.1";
double d = atof(str.c_str());
Run Code Online (Sandbox Code Playgroud)
但这不起作用,它只返回1;
但如果我尝试:
string str = "1,1";
double d = atof(str.c_str());
Run Code Online (Sandbox Code Playgroud)
它返回1.1.
这真的很奇怪.似乎只有我写一个","它才能理解数字,但返回为".".
任何想法我怎么能解决这个转换"1.1"呢?