I have visual studio 6 and want to make a mfc dialogue application that is allays on top. By this i mean whatever programs you have open it will allays be on top. It's window will be fairly small so it doesn't get in the way. the reason for always on top, is its going to be a plug in for another program, and the plug in code, which i already know how to use, will let the plug in send and receive data from the other program, but for the use i have in mind, they need to be able to always type in my plug in, while seeing the other program below it. That way if they click on the other program, say they want to copy text, the plug in would remain visible. Additionally if there was a way it could always be on top of other programs but still be minimized, that would be even better.

Mike

Recommended Answers

All 3 Replies

Try the following, in the dialog box's OnInitDialog() handler ..

CDialog::OnInitDialog();

SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);

Additionally if there was a way it could always be on top of other programs but still be minimized, that would be even better.

Sorry, but I don't quite understand what that would mean.

I don't know much mfc but with winapi you could do it with SetWindowPos() as above, or set the window extended style to WS_EX_TOPMOST if I remember correctly. Hope it helps.

As far as I know winapi functions can be called from an mfc application.

thanks for the feedback. will try this stuff this weekend.

Mike

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.