News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Find your own edit box handle?

Started by hfheatherfox07, July 24, 2011, 02:19:28 AM

Previous topic - Next topic

hfheatherfox07

Hi Is there a way to get your own edit box handle?
what I am trying to do is use vortex's Autotyper example to make an example were I auto type in my own edit box , not note pad's

So how do I get my own windows edit box handle?

Gunner

Whaddya mean?  When CreateWindow/Ex returns, it returns the edit controls handle you just created... save that.  Or if you are using dialogs, then in your WM_INITDIALOG  invoke GetDlgItem, YOURDLGHANDLE, CONTROLID# and that will return the handle in eax, save it
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

hfheatherfox07

I am trying to make an auto typing example in my own exe how do I get my own edit box handle for that .... Here is an example were I took vortex's original autotyper for note pad and made it work with any window
I want to autotype in my owns app edit box were I use dialogs

hfheatherfox07

Quote from: Gunner on July 24, 2011, 02:41:54 AM
Whaddya mean?  When CreateWindow/Ex returns, it returns the edit controls handle you just created... save that.  Or if you are using dialogs, then in your WM_INITDIALOG  invoke GetDlgItem, YOURDLGHANDLE, CONTROLID# and that will return the handle in eax, save it

I get "CONTROLID#" I don't get " YOURDLGHANDLE"

suppose I got

.cost
EDIT1     equ 222

would this be :

invoke GetDlgItem,EDIT1 ,222  ?

Gunner

YOURDLGHANDLE is the handle from your window proc... whatever you have it called:
DialogProc proc hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM

so it would be invoke GetDlgItem, hWnd, EDIT1

It is the handle of the dlg that your control is on
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

hfheatherfox07

NOP.... For some reason this method does not work well for me ...

As I mentioned before I took Vortex's Autotyping example and I am trying to make a self typing window, the only way that I was able to get some results was to put it in a proc.

I tried two versions :
1. with a button to invoke the proc ( which works better)
2. a version were the proc gets invoked at WM_INITDIALOG

Version 2 which I want to work , doesn't....  the GUI starts , it types... than it shows on the screen ???

Is there away to capture the edit handle then release it when done , like invalidate handle

Gunner

INVOKE GetDlgItem,hWnd,102
mov   hEdit,eax
INVOKE Autotyperproc,eax
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

Gunner

missed something
invoke ShowWindow, hWnd, SW_SHOW
invoke UpdateWindow, hWnd
  INVOKE SetWindowText, hWnd, addr szTitle
  INVOKE SendMessage, hWnd, WM_SETICON,ICON_SMALL, hIcon
  INVOKE GetDlgItem,hWnd,102
   mov   hEdit,eax
  INVOKE Autotyperproc,eax

adding showwindow and updatewindow could be done better by creating a seperate thread for AutoTypeProc
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com