how get string out of a textbox?
Posted: Sat Oct 10, 2009 4:06 am
I want to use the "AtoI()" function to store the string in a textbox to an integer.
I want to send keystrokes to firefox ( works with giving the integer a value like "int sleeptime = 350"
sleeptime is the delay between the keystrokes.
I have no idea how to get the text out of that textbox. the help file only showed me how to create the textbox ( if it is in the helpfile I am blind I guess )
I want to send keystrokes to firefox ( works with giving the integer a value like "int sleeptime = 350"
sleeptime is the delay between the keystrokes.
I have no idea how to get the text out of that textbox. the help file only showed me how to create the textbox ( if it is in the helpfile I am blind I guess )
- Code: Select all
bool bAddy;
int sleeptime; //if I set this integer to for example 500 the script works.
VOID Spawnmenu() {
HWND spawnmenu = CreateDialog(NULL, "Udom Spawner", 129, 176, 136, 57, "ret_spawnmenu");
if ( spawnmenu == NULL ) { return; }
bAddy = false;
enum {
CTRL_LABEL0,
CTRL_TEXTBOX0,
spawncheckv,
};
if (!AddLabel(spawnmenu, 0, 0, 40, 20, CTRL_LABEL0, "Delay:")) { return; }
if (!AddEdit(spawnmenu, 40, 0, 40, 20, CTRL_TEXTBOX0, "textbox")) { return; }
if (!AddCheck(spawnmenu, 80, 0, 40, 20, spawncheckv, "Go!", "spawncheck")) { return; }
}
BOOL ret_spawner( HWND hWnd, UINT uiMsg, LONG wParam, LONG lParam ) {
//This function will handle the window messages.
//The return value is ignored.
}
VOID spawncheck( HWND hOwner, HWND hCheck, BOOL bChecked ) {
if(bChecked==true){
bAddy = true;
}
else{
bAddy = false;
}
if (bAddy == true){
HANDLE hAddy = CreateThread("Addy", 0);
if (!hAddy) { bAddy = false; return; }
CloseHandle(hAddy);
}
}
VOID Addy(DWORD dwParam){
if(bAddy == true){
Sleep(500);
//backwards
for(int i = 0; i < 50; i++){
KeyboardEvent( VK_MENU , 0 );
KeyboardEvent( VK_LEFT , 0 );
KeyboardEvent( VK_MENU , KEYEVENTF_KEYUP );
KeyboardEvent( VK_LEFT , KEYEVENTF_KEYUP );
Sleep(sleeptime);
}
//forwards
for(int i = 0; i < 50; i++){
KeyboardEvent( VK_MENU , 0 );
KeyboardEvent( VK_RIGHT , 0 );
KeyboardEvent( VK_MENU , KEYEVENTF_KEYUP );
KeyboardEvent( VK_RIGHT , KEYEVENTF_KEYUP );
Sleep(sleeptime);
}
Warning("Done");
}
}
VOID textbox( HWND hOwner, HWND hEdit ) {
sleeptime = AtoI(?????); //it gave a number close to 0. ( sorry if it is hEdit, but it did not work >.<)
}
VOID On_HK_0( DWORD dw1, DWORD dw2 ) {
Spawnmenu();
}