Click here to Skip to main content
15,913,773 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
kk_vp19-Aug-05 4:32
kk_vp19-Aug-05 4:32 
GeneralRe: updating Edit box in a Dialog from Callback function. Pin
MailtoGops22-Aug-05 0:23
MailtoGops22-Aug-05 0:23 
GeneralMIMESniffer.DLL MIME to HTML Conversion Problem ( if MIME tag starts with <DIV>,<P> or <UL> Pin
chandan kumar19-Aug-05 2:08
chandan kumar19-Aug-05 2:08 
GeneralRe: MIMESniffer.DLL MIME to HTML Conversion Problem ( if MIME tag starts with <DIV>,<P> or <UL> Pin
Jose Lamas Rios19-Aug-05 2:55
Jose Lamas Rios19-Aug-05 2:55 
GeneralMIMESniffer.dll MIME to HTML conversion problem Pin
chandan kumar19-Aug-05 2:06
chandan kumar19-Aug-05 2:06 
QuestionCreate a button that can be dragged and dropped?? Pin
Hachaso19-Aug-05 1:15
Hachaso19-Aug-05 1:15 
AnswerRe: Create a button that can be dragged and dropped?? Pin
toxcct19-Aug-05 1:51
toxcct19-Aug-05 1:51 
AnswerRe: Create a button that can be dragged and dropped?? Pin
MailtoGops19-Aug-05 3:11
MailtoGops19-Aug-05 3:11 
Hi,

There is no direct method available for this..

You can follow the following steps.

Assumption: Parent window and children to be draged already created

You need to handle three mouse events.. WM_LBUTTONDOWN, WM_MOUSEMOVE, WM_LBUTTONUP

1. In the WM_LBUTTONDOWN message, call the SetCapture function with the control ID

2. In the WM_MOUSEMOVE message, call the GetCapture method and check the returned Window handle againt the your window child control window handle. If both are same, call SetWindowPos() to set the control new position.

3. In the WM_LBUTTONUP, check for the GetCapture() returned window handle is equal to your window control handle. If it is call ReleaseCapture() method, and once again place the window control by using SetWindowPos().

One more thing you have to take care is , when user clicks the button, he can drag that button out of parent window. To avoid such a situation, call the ClipCursor() function with the parent window rectangle size values...Then don't forgot to free the cursor. That you can do it by ClipCursor(NULL)..

Enjoy programming...





" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "

- Words from Nelson Mandela

Thanks & Regards,

Gopalakrishnan
GeneralRe: Create a button that can be dragged and dropped?? Pin
Hachaso22-Aug-05 21:43
Hachaso22-Aug-05 21:43 
GeneralRe: Create a button that can be dragged and dropped?? Pin
MailtoGops23-Aug-05 0:29
MailtoGops23-Aug-05 0:29 
GeneralString* char* Memory issue Pin
s2111979219-Aug-05 1:05
s2111979219-Aug-05 1:05 
GeneralRe: String* char* Memory issue Pin
Bob Stanneveld19-Aug-05 1:28
Bob Stanneveld19-Aug-05 1:28 
GeneralRe: String* char* Memory issue Pin
s2111979219-Aug-05 2:21
s2111979219-Aug-05 2:21 
GeneralRe: String* char* Memory issue Pin
Maximilien19-Aug-05 2:44
Maximilien19-Aug-05 2:44 
GeneralRe: String* char* Memory issue Pin
s2111979219-Aug-05 3:13
s2111979219-Aug-05 3:13 
GeneralRe: String* char* Memory issue Pin
Bob Stanneveld19-Aug-05 3:25
Bob Stanneveld19-Aug-05 3:25 
GeneralControl ghosting during dialog resize Pin
rem-c19-Aug-05 0:38
rem-c19-Aug-05 0:38 
GeneralRe: Control ghosting during dialog resize Pin
Roger Allen19-Aug-05 3:44
Roger Allen19-Aug-05 3:44 
GeneralRe: Control ghosting during dialog resize Pin
Gary R. Wheeler19-Aug-05 4:02
Gary R. Wheeler19-Aug-05 4:02 
GeneralRe: Control ghosting during dialog resize Pin
rem-c19-Aug-05 4:56
rem-c19-Aug-05 4:56 
QuestionI want a file DLL write by VC++ used in VisualBasic ? Pin
Thangnc19-Aug-05 0:30
Thangnc19-Aug-05 0:30 
AnswerRe: I want a file DLL write by VC++ used in VisualBasic ? Pin
David Crow19-Aug-05 2:30
David Crow19-Aug-05 2:30 
GeneralRe: I want a file DLL write by VC++ used in VisualBasic ? Pin
Thangnc19-Aug-05 16:13
Thangnc19-Aug-05 16:13 
GeneralRe: I want a file DLL write by VC++ used in VisualBasic ? Pin
David Crow22-Aug-05 3:13
David Crow22-Aug-05 3:13 
QuestionHelp! CString convert to LPBYTE ? Pin
alias001818-Aug-05 22:28
alias001818-Aug-05 22:28 

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.