|
I'm having problems with the window generation of the following code on a Win9x system.
The window is a "child" window that contain a menu and is allowed to be anywhere on the screen, it's not contain
by the parent window. On a win9x system when the window first appears the menu is present but can not be
activated. It seems that is is just drawn and thats it. If I force a redraw the menu goes away entirely.
On a W2K system the menu appears, is active and the entire function of of the window works fine.
I must be missing something ?
Thanks in advance
Tony Teveris
<br />
int iCaptionHite = GetSystemMetrics(SM_CYSIZE) + GetSystemMetrics(SM_CYFRAME);<br />
<br />
CMenu *pMenu = new CMenu;<br />
pMenu->LoadMenu(IDR_VIEW);<br />
<br />
pFW->CreateEx(WS_EX_WINDOWEDGE,<br />
AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW, AfxGetApp()->LoadStandardCursor(IDC_ARROW),0,AfxGetApp()->LoadIcon(IDI_FONTVIEW)),<br />
"My Test",<br />
WS_OVERLAPPEDWINDOW | WS_POPUPWINDOW | WS_CAPTION | WS_THICKFRAME | WS_VISIBLE ,<br />
iCaptionHite, iCaptionHite, GetSystemMetrics(SM_CXSCREEN)/3, GetSystemMetrics(SM_CYSCREEN)/3, m_pOwner->GetSafeHwnd(), pMenu->GetSafeHmenu(), NULL);<br />
<br />
delete pMenu;<br />
<br />
pFW->UpdateWindow();
Tony Teveris
Gerber Scientific Products
Senior Software Engineer
Phone: 860 648 8151
Fax: 860 648 8214
83 Gerber Road West
South Windsor, CT 06074
|
|
|
|
|
Hi.
Would anyone know how to retrieve a mainframe hWND from a process handle ?
If you use openProcess to get a process handle, how can you find that process's mainframe hWND ?
|
|
|
|
|
You could go loop through the top level windows (children of the desktop)
and check if their process ID matches the one you are after...
See DWORD GetWindowThreadProcessId (HWND hWnd, DWORD *dwID);
I hope this helps,
Iain.
|
|
|
|
|
Hi
I succesfully added new storage into MSWord compound file (and new stream inside this new storage), but the problem is that when I open this doc in MSWord, made some change and save doc, my storage and stream dissapears. I saw application that adds stream(in root storage) which is "word saving proof" but I don't know how to do this. I also encountered strange thing: when I have word doc with stream added by this application, storage and stream added by me doesn't dissapear. I don't know why this happens. Anyone have some idea how to prevent new streams and storages from deleting by Word? Thanks in advance for any hints.
Greetings
Mariusz Popiolek
|
|
|
|
|
How do I extract file/path name from the HDROP passed from WM_DROPFILES??? Couldn't find anything here or MSDN
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
MSDN:
Drag-and-Drop Operations
To support a drag-and-drop operation in a rich edit control, an application must first set an event mask by using the EM_SETEVENTMASK message to allow the EN_DROPFILES notification to be sent to the control's parent window. In the RICHED sample, when the parent window receives this notification, the DragQueryFile function is called to determine how many files have been dropped in the rich edit control. This sample allows the user to drop only one file at a time, so if more than one file has been dropped, the action is disallowed. If the user has dropped only one file, the application queries for the filename, opens the file, and reads it into the rich edit control. As you can see in the following code, the sample allows the user to drop only a TXT or an RTF file:
case WM_NOTIFY:
§
// Is the notification a drop notification?
else if (((LPNMHDR)lParam)->code == EN_DROPFILES)
{
WORD cFiles;
char lpszFile [80];
HANDLE hDrop;
// Get the handle to the drop object.
hDrop = ((ENDROPFILES *)lParam)->hDrop;
// Determine how many objects have been dropped.
cFiles = DragQueryFile (hDrop, 0xFFFF, (LPSTR)NULL, 0);
// If more than one object has been dropped, don't bother.
if (cFiles > 1)
return 0;
// Get the name of the file dropped.
DragQueryFile (hDrop, 0, lpszFile, sizeof (lpszFile));
// Open the file (TXT or RTF).
if (strstr (lpszFile, "TXT"))
OpenTheFile (hWndRichEdit, SF_TEXT, lpszFile);
else if (strstr (lpszFile, "RTF"))
OpenTheFile (hWndRichEdit, SF_RTF, lpszFile);
DragFinish (hDrop);
return 1;
}
return 0L;
break;
This code demonstrates one way that an application can handle a drop operation. Rich edit controls also support OLE drag and drop through the IRichEditOle and IRichEditOleCallback interfaces, which allow objects to be embedded in the control. The subject of embedding objects is beyond the scope of this book, however, so I will not cover it here.
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
Nitron wrote:
Couldn't find anything here or MSDN
Hmm, my MSDN (April 2000) says this:
hDrop
Handle to an internal structure describing the dropped files. Pass this handle DragFinish , DragQueryFile , or DragQueryPoint to retrieve information about the dropped files.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I guess I was just looking for something like
hDrop.lpzFileName
Didn't relize I had to read...
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
I want to use CListCtrl's SortItem function. MSDN says there needs to be a comparison function which has to be:
The comparison function must be either a static member of a class or a stand alone function that is not a member of any class.
1. How do I make a static function of a class?
2. If it were a standalone function, I'd declare it in the .h file before the class definition (correct?). Would that be sufficient? Or do I have to specify the prototype in the cpp file before I use it?
Appreciate your help,
ns
|
|
|
|
|
in a .h
class MyClass
{
public:
static int MyFunction(whatever);
};
and then in a .cpp, you implement the function. this function cannot access any non-static member variables of the class.
-c
No matter how fast light travels it finds the darkness has always got there first, and is waiting for it.
-- Terry Pratchett,
|
|
|
|
|
Where is this line supposed to be, from MSDN. In which file is it supposed to be? In the cpp file? If so, in the constructor?
<code>float SavingsAccount::currentRate = 0.00154;</code>
currentRate is a static member variable(declared in the .h file).
Appreciate your help,
ns
|
|
|
|
|
ns wrote:
Where is this line supposed to be,
In the class's .cpp file (theoretically it could be in any .cpp file but the obvious place is that of the class), outside the constructor. It's just a variable initialization.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
I'm trying to automated power point 2002... I have my own activeX, it Power Point 2002, I can activate it just by pressing double click ( then my ActiveX is up and running...).
BUT... in Power Point 2002, I have to go to Slide Show Mode to do that !!!!, is there anyway to activate it in the normal view ?
Thanks, so long
Braulio
|
|
|
|
|
http://www.codeproject.com/com/OLE_Automation.asp
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
Sorry but..
Ms Word and Excel models for automation are not that bad, but things like Power Point, or Outlook, are hell !, just give try to detect when really Power Point has been closed ( yeah you will found a sink, but that sink is just executed right before the message that ask you to cancel or save, so...)...
So long
Braulio
|
|
|
|
|
Hi,all,
About the animal's simulation project, i have another problem to
ask. That is,Whether there is any one who can provide a source code, which can be used for generating a specail terrai manually. Of cause 3D is best, but at first step if a 2D contour map can be displayed, that is enough.
thanks a lot!!!
wang
|
|
|
|
|
|
This is a so very good shameless plug, your product looks very cool indeed !!!
Max.
|
|
|
|
|
Thank you very much, you just made my day.
Chris Richardson
|
|
|
|
|
One might also display that Free Software alternatives exists.
Also, googling for "free terrain generator GPL" might turn up some more interesting code (replace GPL with whatever license you fancy).
|
|
|
|
|
Yes, I could display that free software alternatives exist, but (A) I didn't feel like searching for it, and (B) my link was put inside < shameless plug > tags. Plus, most free software doesn't come with support, a lot of it can't be used for commercial work, etc.
Chris Richardson
|
|
|
|
|
The derived class has a deleteAllItems, so does the parent class (CListCtrl). I want to invoke the base function directly with a control variable of the derived class. Instead of
m_list1.DeleteAllItems() which is the derived class definition,
I want to call the listctrls base function: Is it possible to do that?
Appreciate your help,
ns
|
|
|
|
|
You could Cast into a base-Object:
CListCtrl* pListC = &MyDerivedListCtrl;
pListC->DeleteAllItems();
|
|
|
|
|
Thanks!
Appreciate your help,
ns
|
|
|
|