|
Michael Liu wrote:
PM_QS_PAINT or some other values to specify that only certain message should be processed.
Never heard of it. Are you sure it's not an example of a user defined message ?
Michael Liu wrote:
I got compile warning:'AllowSetForegroundWindow' undefined
I have never heard of this either. MSDN says it's defined for Windows ME and 2000 only ( I presume XP has it as well ). This means that any code that uses it will not run on W95/98/98SE/NT and also means you'll need to download the platform SDK ( about 500 MB, also available on CD ) in order to use it.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
PM_QS_PAINT :
MSDN give us four values to specify that only certain message should be processed. Do you know how to specify those values?
1. PM_QS_INPUT Windows 98/Me, Windows 2000/XP: Process mouse and keyboard messages.
2. PM_QS_PAINT Windows 98/Me, Windows 2000/XP: Process paint messages.
3. PM_QS_POSTMESSAGE Windows 98/Me, Windows 2000/XP: Process all posted messages, including timers and hotkeys.
4. PM_QS_SENDMESSAGE Windows 98/Me, Windows 2000/XP: Process all sent messages.
AllowSetForegroundWindow():
But I can use SetForegroundWindow(). This function needs the same requirements as AllowSetForegroundWindow().
Thx.
mIchAel Liu
|
|
|
|
|
Michael Liu wrote:
PM_QS_PAINT
Ah.. I did not know about it because I've never used it. Apart from GDI+ and transparent windows, I don't think I've ever used anything that requires the SDK. Look at the requirements you just posted and you'll realise I've answered your question. You need the SDK.
Michael Liu wrote:
But I can use SetForegroundWindow(). This function needs the same requirements as AllowSetForegroundWindow().
Not true. "Minimum operating systems Included in Windows 95, Windows NT 3. "
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
|
I've installed the latest SDK. How can I use the latest SDK with VC6? Thx.
mIchAel Liu
|
|
|
|
|
Wow - you must have an MSDN subscription. The SDK should set up it's paths so that it is automatically integrated with VC.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
Michael Liu wrote:
AllowSetForegroundWindow():
But I can use SetForegroundWindow(). This function needs the same requirements as AllowSetForegroundWindow().
It looks like AllowSetForegroundWindow is a newer function. Have you got the latest platform SDK or are you still using the headers that came with VC6?
Michael
Look, try and use your intelligence, man, even if you are a politician. - The Doctor
|
|
|
|
|
I'm using the headers that comes with VC6(sp5). I have MSDN(Jan. 2002). Is the SDK in that CD? Thx.
mIchAel Liu
|
|
|
|
|
If you have an MSDN subscription other than the Library, you should have a CD with the platform SDK. If you only have a library subscription you'll need to obtain the platform SDK from the MSDN site.
Michael
Look, try and use your intelligence, man, even if you are a politician. - The Doctor
|
|
|
|
|
|
I've installed the latest SDK, how can I updated the vc6 include file? Just copy those files? Thx.
mIchAel Liu
|
|
|
|
|
I feel like I'm missing something - I just try to load a text file into an Multiline EDIT, modify it, and save it again as text file. (should match notepad's behavior of hard line breaks)
Issue: just taking the file size and loading does not work because of the \n <--> \r\n conversion. For saving, it seems to double the line breaks, so it's bad again.
All I came up was either reading line-by-line, or reading as binary and do the replacements on my own. Which sounds a bit awkward.
Any suggestions?
TIA
Peter
We are ugly but we have the music Leonhard Cohen [sighist]
|
|
|
|
|
1) I tried putting the following:
CNewDialog cDlgNoOk;
cDlgNoOk.m_edit1.SetFocus();
Got a debug assert when it ran.
2) Then I tried putting it in the constructor- still asserts:
CNewDialog::CNewDialog(CWnd* pParent /*=NULL*/)
: CDialog(CNewDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CNewDialog)
none = NULL; // NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_edit1.SetFocus();
}
3)Finally I put it in :
BOOL CNewDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_edit1.SetFocus();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
It ran without asserting but the editbox didnt get the focus.....
Any suggestion on how to set the focus?
Thanks,
ns
|
|
|
|
|
please read:
>>
m_edit1.SetFocus();
return TRUE; // return TRUE unless you set the focus to a control
<<
We are ugly but we have the music Leonhard Cohen [sighist]
|
|
|
|
|
I'm going to start reading the comments from now on! THanks so much for pointing me to it...
ns
|
|
|
|
|
Hi all.
Since we have written our own web server, our setup has to detect if there is already a application listening on port 80, so we can notify the user about the conflict. How can I get this information?
Regards
Thomas
Sonork id: 100.10453 Thömmi
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
try bind()ing to the port and if the call fails then something is already on that port. u can however set a socket option to reuse it
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
Brian Azzopardi wrote:
try bind()ing to the port and if the call fails then something is already on that port. u can however set a socket option to reuse it
I already know this. But I want to know the process which uses this port. Thank you anyway
Regards
Thomas
Sonork id: 100.10453 Thömmi
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
I also would like to learn how to do it. I am trying to show the ports in use and which processes are using them.
Orcun Colak
|
|
|
|
|
I've only found a solution for Windows XP: AllocateAndGetTcpExTableFromStack in iphlpapi.dll (found in the sources of Netstatp at Sysinternals)
Regards
Thomas
Sonork id: 100.10453 Thömmi
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
I see hoew to get the oh-so useful document pointer a lot, but if I want to destroy view2 from view1, how do I do that? If I had launched a dialog from my view, then I'd have the name like:
CMyDialog cDlg;
etc
cDlg.DestroyWindow.
But I didnt spawn view2 from view1, so how to I get its name or pointer to call DestroyWindow on it?
Thanks,
ns
|
|
|
|
|
You still need to go via that magic document. The document keeps pointers to all its views, which you can get access to via CDocument::GetFirstViewPosition() and CDocument::GetNextView() (which uses MFC's less than intuitive POSITION based iteration method - look the two methods up in the MSDN Library for details).
You can either call those methods from one view (using the view's pointer to its document) to destroy the other view, or you can define a method in your document which you call from one view to close the other. I prefer the second method, because it means the views don't have to know too much about the views they coexist with.
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|
|
I've created Win32 app (not console app) n' I wanna change the EXE icon
to one of my own.
Help, por favor.
10XXXXXXX x 2
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
I´d try this :
HICON hLargeIcon = LoadIcon ( hinstYourModuleInstance,
MAKEINTRESOURCE(IDI_NEW_ICON) );
HICON hSmallIcon = (HICON) LoadImage ( hinstYourModuleInstance,
MAKEINTRESOURCE(IDI_NEW_ICON),
IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR );
SendMessage ( hwndYourWindow, WM_SETICON, ICON_BIG, hLargeIcon );
SendMessage ( hwndYourWindow, WM_SETICON, ICON_SMALL, hSmallIcon );
taken from this FAQ.
~RaGE();
|
|
|
|
|
During the initialization of your app's main window, you can load an icon from your resources like so:
<br />
WNDCLASS wc;<br />
<br />
wc.lpfnWndProc = (WNDPROC)MainWndProc; <br />
wc.lpszClassName = _T("MyAppClass");<br />
...<br />
wc.hIcon = LoadIcon( hInstance, IDI_APPICON );<br />
...<br />
<br />
if ( ! RegisterClass( &wc ) )<br />
return FALSE;<br />
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|