Click here to Skip to main content
15,890,973 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDetecting UPS State Pin
Blake Miller27-Jan-04 15:01
Blake Miller27-Jan-04 15:01 
GeneralRe: Detecting UPS State Pin
David Crow28-Jan-04 2:33
David Crow28-Jan-04 2:33 
GeneralWierd thing with caption... Pin
Snyp27-Jan-04 14:44
Snyp27-Jan-04 14:44 
GeneralRe: Wierd thing with caption... Pin
alex.barylski27-Jan-04 18:33
alex.barylski27-Jan-04 18:33 
GeneralRe: Wierd thing with caption... Pin
Antti Keskinen27-Jan-04 21:50
Antti Keskinen27-Jan-04 21:50 
GeneralRe: Wierd thing with caption... Pin
Snyp28-Jan-04 12:15
Snyp28-Jan-04 12:15 
QuestionHow to hide a dialog temporarily and go to CView to pick a point? Pin
lxy27-Jan-04 14:25
lxy27-Jan-04 14:25 
AnswerRe: How to hide a dialog temporarily and go to CView to pick a point? Pin
Antti Keskinen27-Jan-04 21:36
Antti Keskinen27-Jan-04 21:36 
For the point-click handling, here's the design routine:

1. Use GetClienRect or GetWindowRect to get the view window's dimensions into a RECT structure. If using GetClientRect, remember to convert into screen coordinates.

2. Use ClipCursor to restrict the cursor into moving inside the defined RECT only. The cursor cannot leave this area now. Also, set a flag e.g. m_bCursorIsClipped to TRUE.

3. In the WM_LBUTTONDOWN handler of the view, check the flag value, and if it says that the cursor is clipped, then first send the point information to the dialog, then remove the clipping rectangle and show the dialog window again, hiding the main view. Lastly, set the flag to FALSE.

The clipping rectangle ensures that the user cannot do anything else on the frame window. He can use ALT+TAB to switch to other programs: in this case, you must handle this request (WM_KILLFOCUS) and remove the clipping rectangle if it exists. You can re-set the clip in WM_SETFOCUS handler, if needed.

You should code a new user message for the view, called WM_USER_PICKPOINT, for example. Then in the dialog's button click handler, issue this message to the view window after hiding the dialog and showing the main frame. The handler for this message in the view window sets the cursor clipping region and the flag. The clipping region is removed and the flag nullified in the WM_LBUTTONDOWN handler of the view window, like I explained above.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: How to hide a dialog temporarily and go to CView to pick a point? Pin
Anonymous28-Jan-04 16:44
Anonymous28-Jan-04 16:44 
QuestionHow can I get the file size of a file Pin
nachilau27-Jan-04 14:14
nachilau27-Jan-04 14:14 
AnswerRe: How can I get the file size of a file Pin
Brad Bruce27-Jan-04 14:43
Brad Bruce27-Jan-04 14:43 
AnswerRe: How can I get the file size of a file Pin
Michael Gunlock27-Jan-04 17:14
Michael Gunlock27-Jan-04 17:14 
AnswerRe: How can I get the file size of a file Pin
Mukkie28-Jan-04 9:19
Mukkie28-Jan-04 9:19 
GeneralDate format in a List Control Pin
Ger Hayden27-Jan-04 13:20
Ger Hayden27-Jan-04 13:20 
GeneralRe: Date format in a List Control Pin
David Crow27-Jan-04 13:40
David Crow27-Jan-04 13:40 
GeneralRe: Date format in a List Control Pin
Ger Hayden27-Jan-04 19:48
Ger Hayden27-Jan-04 19:48 
GeneralRe: Date format in a List Control Pin
David Crow28-Jan-04 2:28
David Crow28-Jan-04 2:28 
GeneralRe: Date format in a List Control Pin
Ger Hayden31-Jan-04 0:03
Ger Hayden31-Jan-04 0:03 
QuestionHow can I send a certain key to a certain application? (simulate keyboard) Pin
andreir2327-Jan-04 12:19
andreir2327-Jan-04 12:19 
AnswerRe: How can I send a certain key to a certain application? (simulate keyboard) Pin
john john mackey27-Jan-04 12:43
john john mackey27-Jan-04 12:43 
AnswerRe: How can I send a certain key to a certain application? (simulate keyboard) Pin
__Cerb27-Jan-04 14:35
__Cerb27-Jan-04 14:35 
GeneralRetrieve a user's email accounts Pin
LukeV27-Jan-04 12:11
LukeV27-Jan-04 12:11 
GeneralRe: Retrieve a user's email accounts Pin
David Crow27-Jan-04 13:41
David Crow27-Jan-04 13:41 
GeneralRe: Retrieve a user's email accounts Pin
Snyp27-Jan-04 14:49
Snyp27-Jan-04 14:49 
GeneralCPropertySheet - access Page variables Pin
john john mackey27-Jan-04 11:31
john john mackey27-Jan-04 11:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.