|
Hello,
Could anyone please show me how to create an Always On Top window like ICQ or Task Manager except it is transparent? I want the window to be Topmost and no application being maximized can stay above it. I am creating my window like this, but it is not always on top. Please help, tell, or show me what to do, thank you.
// Create the window (this doesn't work, I don't know why)
// If I do a Alt-Tab, other windows being maximized can still go above it
hwndHotkey = CreateWindowEx(WS_EX_TRANSPARENT | WS_EX_TOPMOST,
szWindowNameHotkey, NULL,
WS_POPUP, 0, 0,
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN),
NULL, NULL, ghInstance, NULL);
SetWindowPos(hwndHotkey,
HWND_TOPMOST,
0,
0,
0,
0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
|
|
|
|
|
Try to write: SetWindowPos(&wndTopMost, ... );
When I use (for example) SetWindowPos(&wndTopMost,1,1,200,200,SWP_SHOWWINDOW );
my dialog window is always on top.
Best regards, Vitaliy
|
|
|
|
|
How do I go about keeping my form-view based app from being resized, I'd also like to hide the maximize/restore restore button....
|
|
|
|
|
Try catching the WM_SIZE/WM_SIZING message but don't resize anything. I don't know how to hide the maximize/restore button.
Here are a couple links you may find interesting:
OnSizing
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cwnd.3a3a.onsizing.asp
OnSize
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cwnd.3a3a.onsize.asp
Hope that helps.
|
|
|
|
|
You need to remove a couple of window style flags from the main frame: WS_THICKFRAME and WS_MAXIMIZEBOX. The easiest way to do this in MFC is to override CWnd::PreCreateWindow().
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
cs.style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX);
return TRUE;
}
--------------
"Aagh!! I'm a victim of a Random Act of Management!"
|
|
|
|
|
Ulf is on the right track. However, I like the thick frame style so I take a somewhat backdoor approach. Catch the WM_NCHITTEST message (I think it is), which is the non-client hit test and tell the OS that it never hits the corners or sides. If you don't want it to be unmoveable then don't "let" it hit the title bar. This way, you can have a standard appearance but the window will be non-resizable and unmovable.
|
|
|
|
|
I agree that apps look better with the thick border style. Catching WM_NCHITTEST is not 100% foolproof, though. It prevents the user from resizing the window, but Windows can still resize it (if the user, for example, clicks "Tile windows" from the task bar). Also, if the window has a status bar, it can be resized with the status bar's gripper. These problems can be solved by catching WM_GETMINMAXINFO and setting the window's min and max tracking sizes.
--------------
"Aagh!! I'm a victim of a Random Act of Management!"
|
|
|
|
|
I'm working on a personal project using MFC. I'm still a beginner with it, however One thing that I'm having problems with is trying to figure out how to communicate between the different components of my application. I have a Main Frame window with the Report Control View (http://www.codeproject.com/miscctrl/reportctrl.asp), a toolbar, and a menu. Now, what I would like to do is allow the user to delete/edit entries in the view using the keyboard (catching windows messages for the view) and also using the toolbar and menu on the main window. How can I communicate with the view through the main window class? I'm finding it confusing trying to figure out the message maps for both view and frame.
I'm sure it will fall together when I get other peoples' ideas. I hope my description wasn't too confusing
Any help will be appreciated.
|
|
|
|
|
|
How can I communicate with the view through the main window class?
2 ideas: CFrameWnd::GetActiveView() and cast to your view class or keep a pointer to your view as a member of your frame class. Set it in OnCreate(...)
Now if only someone would answer my question. I did this for good karma
|
|
|
|
|
It works on NT 4.0, Win95 and Win98 but fails on a windows 2000 computer. I have Client for Microsoft Networks (with file sharing enabled), TCP/IP and NetBEUI network protocols installed.
Any ideas?
Cathy
|
|
|
|
|
Hi Cathy,
What does CFileException* pException tell you is wrong?
(Some good karma for me )
Neville Franks, Author of ED for Windows
www.getsoft.com
|
|
|
|
|
"An invalid file handle was associated with \\ComputerName\DirName\filename.ext"
This is the code:
serverfile.Open(csServerFileName, CFile::modeCreate |
CFile::modeWrite |
CFile::typeBinary, &e)
This works fine from other operating systems.
Cathy
|
|
|
|
|
My guess is that you're using a UNC and MSDOS doesn't know about such things.
Neville Franks, Author of ED for Windows
www.getsoft.com
|
|
|
|
|
I'm running on a win2000 machine trying to read a shared file on an MSDOS machine.
The same code runs without problems on 95, 98, ME and NT 4.0
|
|
|
|
|
Look at the actuall OS Error code being returned from the CFileException and see if you get find more detailed info about it. eg. Lookup MSDN for the extended error code in question.
It may be a security issue, but that's a wild stab in the dark.
Neville Franks, Author of ED for Windows
www.getsoft.com
|
|
|
|
|
It returns 66. I will look into it more on Monday.
Have a good weekend and thank you for your help.
Cathy
|
|
|
|
|
HOw do I make a drop down list multiple selection?
CComboBox has dropdown list but with single selection. Wheread if i use listbox with multiple selection, I do not get the dropdown feature.
Please help!!!
e-mail me at ananya@yahoo.com
|
|
|
|
|
I respond for here because i get this
Your message did not reach some or all of the intended recipients.
Subject:
Sent: 7/27/2001 4:36 PM
The following recipient(s) could not be reached:
'ananya@yahoo.com' on 7/27/2001 4:36 PM
Unable to deliver the message due to a communications failure
The MTS-ID of the original message is: c=US;a= ;p=Nixor Corp;l=NIXORMAIN-010727203609Z-35
Why a combobox multiselecction?
The combo box only show the selection, and is for this that you only can select a item.
Why you can't use the listbox?
Carlos Antollini.
|
|
|
|
|
I received the same email error messsage as the other poster, so I am going to apply here as well ...
While this is not the best solution, and by no means the only one, I believe Microsoft has an ActiveX (OCX) Multi-Select ComboBox control available. While this is obviously not going to be a native code solution to your issue, based on the sense of urgency in your message, I'm guessing this "fix" will do.
Check your local machine first for installed ActiveX components, if you don't see one there, you should be able to locate it on the Microsoft website.
At the very least, this will fix your issue until you can implement a native C++ solution in your code.
Good-Luck,
D.
|
|
|
|
|
Check out this article:
http://www.codeproject.com/combobox/checkcombo.asp
|
|
|
|
|
I have changed out the main framework icon IDR_MAINFRAME with a 32bit color icon that I'd like to use. When I run my application in debug mode, I received about 5 "User Break Point" error messages from the depths of the MFC yelling about "invalid heap pointers" and whatnot; yet my program runs.
Release mode, of course, it all works wonderfully.
Is there a AFX setting, project setting, or something else I can set, define or include that will suppress these "user break points"? Additionally, if you can provide me a little "in-sight" as to why this occurs along with your answer to my original question, it would be greatly appreciated (I'm sure others would like to know as well).
Thank you kindly,
D.
|
|
|
|
|
Is there a AFX setting, project setting, or something else I can set, define or include that will suppress these "user break points"?
This is only a side-effect of heap corruption caused by your app. You should use BoundsChecker or Purify to find out where things get screwed.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Tomasz:
I'd like to say this was indeed the problem, but I am unsure. To trouble shoot, I created an entirely NEW SDI project using the MFC Wizard. I imported my 32bit color icon, deleted the original MFC generated IDR_MAINFRAME icon from my resource file and named my new imported icon ID to IDR_MAINFRAME.
Clean. Rebuild all.
If I just "run" (!) the program it works, but when running in debug (F5) I get user breakpoints. The stack show I'm in NTDLL when I get a "heapblock modified" error message.
I've not written a single line of code at this point, I've only replaced the default 16 color icon with a true color icon.
D.
|
|
|
|
|
Hi,
I would like to create a function to calculate a checksum for a arraydata.
But I don't understand what I want for this checksum :
" lower 8 bits of the sum from data1 to data10 equals to zero".
My english is not perfect but I understand the sum of the data1 to data10 but equals to zero, I don't understand.
Best regards
youssef
|
|
|
|