|
|
I have a dialog app and I want to fire off a child window which is the equivalent of a ("modeless") MFC SDI 'app' (with no doc/view support) showing a CListView.
Where do I start!?
Regards,
Jason
|
|
|
|
|
In your main dialog class, prepare:
private:
CYourModelessDlg* m_pYourModelessDlg;
then in your OnInit for main dialog:
this->m_pYourModelessDlg = new CYourModelessDlg
this->m_pYourModelessDlg->Create( IDD_YOUR_DIALOG, AfxGetMainWnd());
in your fcn that will show the dlg:
this->m_pYourModelessDlg->ShowWindow(SW_SHOW);
then when you handle WM_CLOSE for your main dlg:
delete this->m_pYourModelessDlg;
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Thanks nitron, but what about the CListView part...?
I effectively want a FULL APP as a child and modeless window. In otherwords, I want to see menu/toolbar, etc...
Jason
|
|
|
|
|
design the dialog in the resource editor like the primary dialog. In the properties of the dialog, pick which menu you want to load. Add the List control to the dialog like any other control. If you are a purist and don't use the resource editor, I guess you can dynamically create the controls and menus if you want...
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
|
I'm trying to give my Outlook Plugin (It's a COM dll) the XP themes but the manifest file I used to use for standalone apps doesn't work...
I got some info on: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwxp/html/xptheming.asp[^] but I don't understand that part
Add the manifest to your application's resource file as follows:
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.manifest"
Winuser.rh includes the following defines:
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
#define CONTROL_PANEL_RESOURCE_ID 123
#define RT_MANIFEST 24
Can anyone help me out? Thanks!
---------------
Concentrating on Ideas
http://www.edovia.com
|
|
|
|
|
The resource ID needs to be 2 for DLLs, 1 is for EXEs.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
|
I cant debug this since it happens sporadically. Basically sometimes my trackPopupMenu context menu doesnt show up when I right click on the control where its s upposed to be enabled. Is this a windows bug? If I cant debug it, how shall I figure out whats wrong and how to fix it?
Appreciate your help,
ns
|
|
|
|
|
It's not a bug. The menu appears at the coordinates of the pointer at the time you pick it up with the GetCursorPos() call. Due to the nature of mice and mice movement, coupled with the processing time for the right click, or the context menu key hit, and delays from that action to your application actually processing it because of other processes running, the position may be off from where you expect.
"The greatest danger to humanity is humanity without an open mind." - Ian Mariano
http://www.ian-space.com/
|
|
|
|
|
Okay. I'm localizing it to trigger in a certain rectangle. How can I ensure that the help wil alwayf show? I use getwindowrect to setup the region. I do understand your explanation, but now need a workaround. Thanks for the response!
Appreciate your help,
ns
|
|
|
|
|
As always, use TRACE and ASSERT to verify that your code is actually being called, the menu coordinates are valid, and the popup menu is successfully loaded. These are simple debugging techniques that will help point out the problem.
Suggestion: don't put a breakpoint in the popup code, as this could screw up the coordinates and the R-mouse button handling during debugging.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
It may be too much effort, I don't see how you can get around the kernel scheduler / main windows OS message pump to totally ensure you will get a precise mouse pointer location, perhaps in the embedded versions of Windows...
"The greatest danger to humanity is humanity without an open mind." - Ian Mariano
http://www.ian-space.com/
|
|
|
|
|
Maybe ::GetMessagePos() can help you here? Called in you OnContextMenu() , it returns the position of the mouse when the message was generated instead of where the mouse is right now.
|
|
|
|
|
Sometimes one forgets the simple API calls in life
"The greatest danger to humanity is humanity without an open mind." - Ian Mariano
http://www.ian-space.com/
|
|
|
|
|
What value will dwMajorVersion (OSVERSIONINFOEX ) have if my app is running on XP?
I don't want my app to be run on a Win9x system, only on Win NT, Win 2000 and Win XP.
Can I just check if dwPlatformId is equal VER_PLATFORM_WIN32_NT ??
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
From MSDN:
dwMajorVersion
Major version number of the operating system. This member can be one of the following values. Operating System Value
Windows 95 4
Windows 98 4
Windows Me 4
Windows NT 3.51 3
Windows NT 4.0 4
Windows 2000 5
Windows XP 5
Windows .NET Server 5
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Rickard Andersson wrote:
Can I just check if dwPlatformId is equal VER_PLATFORM_WIN32_NT??
Yes.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
How to simply and only add color to a button and a CEdit control?
Thanks
|
|
|
|
|
OnCtlColor() might be the answer. Good luck!
|
|
|
|
|
With MSVC6, how can I update classes without deleting myproject.clw (plus recreate after restart wizard)? The wizard's data seems not to be updated automatically.
thanks in advance!
|
|
|
|
|
Is there any problem deleting myproject.clw? I thought deleting is the easiest way. If you feel unsafe, you can save a copy as myproject.clw.bak.
|
|
|
|
|
lucy wrote:
Is there any problem deleting myproject.clw?
no, just anoying
After I found out you can save the workspace without restarting VC (or all added files will be lost after a Windows crash), I thought even the wizard can be "forced" to be smart.
|
|
|
|
|
I wanna start WWW service and FTP service in IIS.. with MFC (or WinAPI.. whatever)..
so i made a routine to start / stop IISADMIN service and W3SVC, MSFTPSVC in Windows 2000 advanced Server.. but it didn't work for starting IIS....
What do i do for stating IIS?
I guess an API would be in MSDN... but i haven't found it yet...
Help me plz
|
|
|
|