|
Mike Dimmick wrote:
or you can use DDX_Control in your dialog's DoDataExchange override.
I have used DDX_Control in my dialog's DoDataExchange override:
DDX_Control(pDX, IDC_ELEMENT_LIST, m_elementList);
where m_elementList is of type CElementListCtrl, my ListCtrl derived class. In CElementListCtrl I have both a function to handle the WM_VSCROLL message and an override of PreTranslateMessage() where I put in:
if(pMsg->message == WM_VSCROLL)
AfxMessageBox("WM_VSCROLL message received");
but that if statement never gets executed either, which leads me to believe that this message is never getting sent. I had also tried to put a function in my dialog class to handle the WM_VSCROLL message as well, just to see if the dialog class was getting the message instead of my list control, but it wasn't.
|
|
|
|
|
Hi
I would like to set a packet priority so it can be it gets 1st priority over the packet of other application. I've come accross function setsockopt() of winsock 2.0 but it doesnt seem appropriate. Also in win2k it has a new concept called QoS and in this there is Differentiated Service set of API, would this be appropriate for what i want, how about if one end-point use windows 2000 and the other end use windows 98?
Regard,
|
|
|
|
|
Hi,
I have launched an executable from my program using ShellExecuteEx(). However, I want this program initially to run in the background in a hidden state. Setting the nShow property of the SHELLEXECUTEINFO structure to SW_HIDE in this instance doesn't work - presumably because the launched program won't allow it (in accordance with what it says on MSDN, ie. that this info is passed to the program but it's up to the program how to use it). Thus, I guess I need to explicitly call ShowWindow with SW_HIDE set to hide the window created. The problem is, how do I do this effectively, so that the main window of the program launched is hidden from the very start? At the moment I am using FindWindow(), like this:
<br />
ShellExecuteEx(&app);<br />
<br />
HWND app_hWnd;<br />
<br />
while(app_hWnd == 0)
{<br />
if(WaitForSingleObject(app.hProcess,0)==WAIT_TIMEOUT)<br />
{ <br />
ShowWindow((app_hWnd = FindWindow("app_mainwin",NULL)),SW_HIDE);<br />
<br />
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))<br />
{<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
}<br />
else<br />
{break;}
}<br />
This isn't a great solution, though, as the launched program window is shown for a couple of seconds before FindWindow() and ShowWindow() catch it and hide it.
Does anybody know of a better way of doing this, so that the launched application window is not shown at all until I call ShowWindow again with SW_SHOW?
...Talking of which, I have a secondary problem relating to this. When I do call ShowWindow(app_hWnd,SW_SHOW) to restore the window, even after the window is shown again, it does not appear in the taskbar until I alt-tab out of it and back in again. How do I ensure that a program's window is restored to the taskbar on re-showing it? (I have tried SW_RESTORE, SW_SHOWNORMAL etc...)
Any suggestions or help much appreciated, as always.
Many thanks,
KB
|
|
|
|
|
the struct _SHELLEXECUTEINFO has int nShow;
nShow
Show flags. Can be one of the SW_ values described for theShowWindow function. If the lpFile specifies an executable file, this member specifies how the application is to be shown when it is opened.
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thank you for your reply but if you read my post you will see that I have already explained that this is not working, and why it's not working (because it's up to the application how it handles these flags, see MSDN).
Any help much appreciated,
Thanks,
KB
|
|
|
|
|
i guess then u have to use CreateProcess
and use the wShowWindow of the lpStartupInfo
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
That has already been tried, too. The "show" parameters are ignored if document-type files are specified.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Install system wide hook before launching your missbehaving app. and intercept WM_SHOWWINDOW...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
|
Thanks for the reply, but unfortunately that only works for console/DOS apps (though I tried it anyway) - the app I'm launching is a Win32 EXE...
Thanks for all the suggestions so far,
KB
|
|
|
|
|
|
Hi people !
I must some Pens in my project , but those pens must be created dynamically.
I´ve tried to call new operator , but it always returns NULL :
Pen *PenaI;
PenaI = new Pen(Color(255,255,255,255),1);
(After that , I saw in Debbuger that PenaI is NULL)
Can you help me ?;)
|
|
|
|
|
Hi
If the new-operation fails call GetLastError() to get some more information about the last error.
Look for the error codes at
MSDN library: Error codes
Regards
Frank
|
|
|
|
|
Hi!!
I like to open the web browser in new window and open the site www.codeproject.com. For this purpose i am using the folowing code:
ShellExecute(NULL,"opennew","http://www.codeproject.com","","",SW_SHOWNORMAL);
The above code is not working. If i insert "new" in place of "opennew", it starts working.
Please tell me how can i open browser in new window
|
|
|
|
|
Shah Shehpori wrote:
The above code is not working. If i insert "new" in place of "opennew", it starts working.
Maybe because "opennew" cannot be used unless an actual file is specified (e.g., http://www.codeproject.com/index.htm). To further complicate things, the specified file must be a local file, not an http: file.
I tried several permutations of FindExecutable/ShellExecute/CreateProcess, all to no avail. Internet Explorer does support the -new command-line switch so I think what you want is possible, but just can't put my finger on it at the moment.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
|
Hi Everyone,
I want to ask u how to move character on screen. And also voice hearing. Like MSWord office assistant give some speech. I want like that.
If there is any answer,pl let me know.
Thanks
|
|
|
|
|
sunju wrote:
Like MSWord office assistant give some speech. I want like that.
I think this will require a jog through the SAPI forest.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
sunju wrote:
I want to ask u how to move character on screen
Do you need the character to move freestyle across your app's window or to move within its own window (like the Office Assistant)?
Will the movement be dynamic like in a video game, or pre-determined (like the Office assist.)?
If it is to be pre-determined, then you should just create an AVI file and have it play.
|
|
|
|
|
Hi,
I want to access the content of client area of MDI client window. For example, I want to access the content of word document opened in microsoft word from my application. I used EnumWindows() and EnumChildWindow() and reached upto the handle of MDIChild's frame. I can get & set its caption text. But I unabled to change the text of MDIChild's client area which is actual document content.
Can anyone help me to achieve the goal?
Thanks,
DJ
|
|
|
|
|
Word doesn't expose its client area as a control to which you can send a SetWindowText (or any other kind of) message.
If you want to manipulate a Word document from another application, use Word's OLE Automation programming model.
|
|
|
|
|
Hi Mike,
Thanks for replying. Actually, I dont want to access the client area of Microsoft Word. I want to access the client area of a simulator software(from 3rd party). I refer microsoft word just to visualise my problem.
Can you let me know, how to access client area of any standard MDI Child application?
Thanks
DJ
|
|
|
|
|
We had some code, which mysticly worked on NT4
void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
CFrameWnd::OnActivate(nState, pWndOther, bMinimized);
if(nState == WA_INACTIVE)
ChangeDisplaySettings(NULL, 0);
if(nState != WA_INACTIVE){
DEVMODE* pDevMode;
pDevMode = new DEVMODE;
pDevMode->dmSize = sizeof(DEVMODE);
if(EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS, pDevMode )){
DWORD dw_width = pDevMode->dmPelsWidth;
DWORD dw_height= pDevMode->dmPelsHeight;
if(dw_width < 1024){
pDevMode->dmPelsWidth = 1024;
pDevMode->dmPelsHeight = 768;
ChangeDisplaySettings(pDevMode, 0);
}
}
delete pDevMode;
}
}
}
if i am changing my resolution to 800x600 and starting the application the resolution is set to 1024x768 (like i expected...) but the start bar is floating around (when it is set to "stay in foreground".. sorry bad translation... but i have got the german version installed)
i've tried out some parameters for ChangeDisplaySettings.. but it didn't work in the way it did in WinNT..
any ideas ?
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Bernhard wrote:
any ideas ?
Well, I'm not quite sure what you are asking. The subject is about changing the resolution dynamically, which you appear to have working. Yes? However, the post itself mentions a floating start bar, at which point I got lost. What exactly are you after?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
the resolution change works.. but the bar (with the start - button.. i don't know the word for this bar).. doesn't seem to recognise the change.. and so it shows up at the old position (in the middle of the screen)
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|