ok 2 things, 1st how could i get the flashing cursor in an edit box without manualy clicking on it? 2nd what would be the best way to keep the mouse from moving outside of the dialog box itself? any help would be apreciated. -brad
Posted on 2001-02-09 10:55:00 by Rage9
Use the GetDlgItem API to retrieve the handle of the edit box and then use SetFocus with that handle. Intercept the WM_MOUSEMOVE (i think) message.
Posted on 2001-02-09 11:19:00 by Hel
A better way to confine the cursor someplace is the ClipCursor API.
Posted on 2001-02-09 11:57:00 by Ernie
Yea I tryed the WM_MOUSEMOVE thing already, ok yea ClipCursor sounds good, but does the top left corner count as 0,0 if not how do i grab that cordinate? -brad
Posted on 2001-02-09 12:19:00 by Rage9
USe the API like this:

;Get the dialogs window rectangle on the screen
invoke GetWindowRect, hDlg, addr WndRect

;Limit the cursor to that area
invoke ClipCursor, addr WndRect

;Do stuff in here

;Now set the mouse back to normal
invoke ClipCursor, NULL
In the windows API it says that if you try to set the cursor outside of this rectanlge using SetCursorPos or the mouse, windows will automatically adjust the cursor co-ords to the nearest point within the rectangle. Hope this works for you! See ya, Ben
Posted on 2001-02-09 13:16:00 by cyberben
thanks so much! -brad
Posted on 2001-02-09 13:41:00 by Rage9
Are you sure that you really want to do this... I find those programs that limit your mouse movements incredibly annoying.
Posted on 2001-02-09 21:33:00 by mega
yes im sure its for a computer protection program im storming up, im trying to make it as effective as i can. Im thinking of putting it up as open source when im done, mabe. -brad
Posted on 2001-02-09 22:09:00 by Rage9