Hello. Im new to C++ and i have a few problems with some code. Im using Visual Studio 2008.
1. I want to SendMessage to send keys to a window, but i cant seem to get the Window Handle to work. Heres the code im using atm.
Code:
#include <windows.h>
int main () {
HWND hWnd;
hWnd = FindWindow(NULL, "Lommeregner");
SendMessage(hWnd, WM_KEYDOWN, VK_NUMPAD1, 0);
SendMessage(hWnd, WM_KEYUP, VK_NUMPAD1, 0);
}
I dont know whats wrong, i've been Googling and Googling but havent found anything.
2. I'm using a ComboBox, normally i would read it like this:
Code:
if(ComboBox2->SelectedItem->ToString() == "1") {
}
else if () and so on.
but i dont know what to write if they didnt choose anything.
Code:
if(ComboBox2->SelectedItem->ToString() == "") {}
Doesnt work.
3. Threading in C# is easy, but how in the name of god do i use Threading in C++? I googled it and i found out that i need to import some kind of home made libary or something because Threading is not pre-installed in C++ or something like that. Any help would be awesome!
Hope you understand theese questions.. Thanks!
- Krillere