|
I would like my newly window to open up with the given sizes. The following code maximizes the window when it gets created. Why doesn't it work? Thanks!
STARTUPINFO stStartUpInfo;
PROCESS_INFORMATION pProcessInfo;
memset(&stStartUpInfo, 0, sizeof(STARTUPINFO));
stStartUpInfo.cb = sizeof(STARTUPINFO);
stStartUpInfo.dwFlags = STARTF_USESIZE;
CreateProcess(NULL, CmdLine, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS,
NULL, NULL, &stStartUpInfo, &pProcessInfo);
|
|
|
|
|
Look like the following is missing:
stStartUpInfo.wShowWindow = SW_MAXIMIZE;
Your code looks like it would show the window hidden as it memsets the struct to zero and 0 is SW_HIDE.
Steve
|
|
|
|
|
The window does show up but it's maximized. That's not what I want. I want the window size to be set to what I defined for dwXSize and dwYSize .
|
|
|
|
|
Try this:
STARTUPINFO si;
ZeroMemory(&si, sizeof(si));
si.cb sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USEPOSITION | STARTF_USESIZE;
si.wShowWindow = SW_SHOWNORMAL;
si.dwX = 0;
si.dwY = 0;
si.dwXSize = 100;
si.dwYSize = 100;
Steve
|
|
|
|
|
It still maximizes the window. Ryan (below) mentioned that application can ignore the STARTUPINFO struct if it wants to. So is there no way around this?
|
|
|
|
|
Before I started to look for ways around it I would verify the code with notepad (an application that respects it, I think) or something. I can't think of any easy way around it. You could install a WM_CBT hook with the SetWindowsHookEx API but this would involve setting a global hook (and thus creating a DLL and taking care that it doesn't crash or effect other applications).
Steve
|
|
|
|
|
An application is free to ignore the values in the STARTUPINFO structure if it wants to.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
My application scrolls data in real-time over several columns using a CListCtrl (MSVC++ 6.0). I'd like to occasionally put a user-message that takes up the entire row, spanning all the columns in the table. The MFC Grid Control doesn't seem to have this feature (hint hint).
Does anyone know if this has been done? Thanks!
Eric
----------------------------------------
Please reply in the forum--email is filtered
|
|
|
|
|
Eric Jacobsen wrote: The MFC Grid Control doesn't seem to have this feature (hint hint).
Which implies that a list control certainly doesn't!
Can you embed an Excel sheet into the application?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Yes, the Excel functionality is just what I'm thinking of, but I think embedding an Excel sheet would probably be overkill
|
|
|
|
|
You could subclass the control and put code in to draw to text manually (just the "full line" text).
Steve
|
|
|
|
|
It's not supported by the control directly, but it isn't terribly difficult.
Review the various custom draw articles in the CListCtrl section here on CP - you want to intercept drawing for a specific row, and draw it yourself.
|
|
|
|
|
This is what I'm looking into now. I'm stumbling a little on the issue of how to derive from CListView because CListView HAS A CListCtrl, but supposedly can act as if it IS A CListCtrl. Thanks for the response...
|
|
|
|
|
Actually, CListView IS a CListCtrl. If you look at the implementation of GetListCtrl(), it merely does
return (*(CListCtrl*)this); or something similar.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
|
Thanks Mike,
I had scanned your article and for some reason didn't think it was what I needed.
It is EXACTLY what I needed, thanks.
Since my derived CListView class IS A CListCtrl apparently, I'm using the ON_NOTIFY_REFLECT version.
Embedding a CString pointer in the items lparam, and using DrawText to draw the string centered in the row. Returning *pResult = CDRF_SKIPDEFAULT to prevent any other drawing in these rows.
|
|
|
|
|
Hi,
can you just provide me the sample code for the same
Regards
Shri
|
|
|
|
|
what is the best way to get the handle of a dialog when it opens?
|
|
|
|
|
something like :
YourDerivedDialog* pDialog( NULL );
pDialog = new YourDerivedDialog;
pDialog->Create ( ... );
HWND = pDialog->GetSafeHwd();
pDialog->DoModal();
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
i must be missing something all i keep getting is a error
EDIT - i found it ::ShowWindow(m_hWnd, SW_RESTORE);
-- modified at 17:23 Wednesday 1st February, 2006
|
|
|
|
|
any one know a good tut on how to do this ive looked on this site and found a few pages but when i tryed to compile them was alot of errors what i want is voltage cpu,vcore,+12,+5,+3 ram speed and volts gfx speed and gfx ram speed and temps for cpu,mb,gfx core and the second temp for gfx card. if it helps i have a ati x850 pro agp gfx card and a asus k8ne-deluxe mb with nf3 chipset. dont want much do i lol
ps. im using ms visual 6.0
-- modified at 14:36 Wednesday 1st February, 2006
|
|
|
|
|
Please, see the attached socks server source (it is tiny) and maybe someone say why ftp works good via socks4 , but socks5 - not! Http works via both socks4 and socks5. Please, help me to find the bug.
source : scware.com/temp.zip
|
|
|
|
|
How to create runtime Screen saver
|
|
|
|
|