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
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.
A better way to confine the cursor someplace is the ClipCursor API.
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
USe the API like this:
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
;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
thanks so much! -brad
Are you sure that you really want to do this... I find those programs that limit your mouse movements incredibly annoying.
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