|
Something like this should remove any borders, unless I missed a border style...
::SetWindowLong(window.getHWND(), GWL_STYLE, ::GetWindowLong(window.getHWND(), GWL_STYLE) & ~(WS_BORDER | WS_DLGFRAME | WS_THICKFRAME));
::SetWindowLong(window.getHWND(), GWL_EXSTYLE, ::GetWindowLong(window.getHWND(), GWL_EXSTYLE) & ~WS_EX_DLGMODALFRAME);
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey thanks to both of you, the above code works perfectly!
Steve
|
|
|
|
|
Thank you,
But it runs just fine in aero interface
|
|
|
|
|
Is it possible to make a dialog based application behave as domodal dialog when it is invoked by shellexecute???
if not, is there any alternative?
|
|
|
|
|
Super Hornet wrote: Is it possible to make a dialog based application behave as domodal dialog when it is invoked by shellexecute???
Yes. The fact that the dialog based application was invoked via ShellExecute() is irrelevant.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello,
It sounds crazy but how can I disable and hide my current view in my SDI app (CHtmlView) (and afterwards display it again)? [1]
I've tried SetVisible and EnableWindow but it does not work.
Background: In a modal dialog I temporarily load a different page for printing. The user should not see that there is another page loading or printing.
Regards,
Niki
[1] With hide/disable I mean e.g. that the current view is just white or even better: just frozen.
|
|
|
|
|
ShowWindow[^](SW_HIDE) and ShowWindow(SW_SHOW) could do the trick
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Thank you!
This seems to do exactly what I was looking for!
Regards,
Niki
|
|
|
|
|
Yourwelcome.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
How to change picture control size(width) at runtime?
I want to resize it in OnSize of formview.
|
|
|
|
|
You can use the MoveWindow()[^] function.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Do you want to change size of picture or control? if its control you can use of SetWindowPos,too.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
How i can get the list of processes currently running in Windows CE remote process viewer?
|
|
|
|
|
Hi,
I'm trying since a while to add some counters to perfmon.
Searching through MSDN brought me to those interesting pages:
Performance Monitoring Reference
Manually Defining Performance Objects
I tried the code snippets given by MS in the second link and it compiled,
but I didn't saw any new Objects in perfmon when running it.
So I instantiated an object of each class (MyPerfObject, MyPerfMonManager) and checked the available methods from the PerfMonManager, also without success.
Has anyone some knowledge about this theme and can give me a working example?
Thanks in advance
|
|
|
|
|
|
Hello,
In my application, I send a print command to my view from a (modal) dialog:
pView->OnCmdMsg(ID_FILE_PRINT, 0, 0, 0);
How can I wait until the printing process has been finished?
Background: In my dialog I want to be able to print other data than loaded into the current view. For this purpose, I save the state of the current view, load another document, print it and afterthe document has finished printing I reload the old document again and close the dialog.
Thank you and regards,
Niki
|
|
|
|
|
I have forgotten a very important issue: The view is a CHtmlView. So my view does not have an own printing mechanism
|
|
|
|
|
Printing is heavily abstracted in windows - this is one of the main selling points they had waaaaaaay back when. But that means you shove data at the print spooler - and you know when that is finished.
But that may then shove data at some remote machine which may or may not complete then.
That may then go to a fancy print system which could batch your print for late at night, for its own convenience.
None of this gets fed back to you.
You could do this:
while (1)
{
if (MessageBox (_T("Has the paper come out yet?"), MB_YESNO | MB_ICONQUESTION) == IDYES)
break;
}
Being slightly serious, the OnCmdMsg (ID_FILE_PRINT, 0, 0, 0) shouldn't return until it's finished its bit of the printing process.
Iain.
|
|
|
|
|
Hello and thank you for your answer!
I do not want to check if the document has printed successfully but it should just be successfully appended to the queue (before the new document is loaded).
I think I managed this (the following code is done in a modal dialog):
CString currentUrl = pView->GetLocationURL();
pView->Pall();
while(pView->GetReadyState() != READYSTATE_COMPLETE)
{
((CMyApp*)AfxGetApp())->Yeild();
}
pView->OnCmdMsg(ID_FILE_PRINT, 0, 0, 0);
pView->Navigate(currentUrl);
EndDialog(FALSE);
The OnCmdMsg(ID_FILE_PRINT) does nothing more than ExecWB(OLECMDID_PRINT,...) in the IWebBrowser2.
And now my "backup question" is.
You said:
"Being slightly serious, the OnCmdMsg (ID_FILE_PRINT, 0, 0, 0) shouldn't return until it's finished its bit of the printing process."
Are you sure that ExecWB(OLECMDID_PRINT,...) will block until the currently loaded document has been printed so that I can issue the next Navigate(...) call just afterwards?
In my tests it works but I am not sure about this.
Regards,
Niki
|
|
|
|
|
I confess I have not printed from an HtmlView, so take my logic with some skepticism.
From the docs:
Executes a command on an OLE object and returns the status of the command execution using the IOleCommandTarget interface.
It does not say "queue up some thready thing". So S_OK, means the job is *done*.
Iain.
|
|
|
|
|
You could obtain a PRINTER_INFO_2[^] structure which contains the number of jobs in the printer que. The Status member should return PRINTER_STATUS_PRINTING while printing and PRINTER_STATUS_WAITING when finished.
If you wanted to track individual print jobs you could use the JOB_INFO_1[^] or other associated print job structures to track the job. The Status member will return JOB_STATUS_PRINTED when the job has completed. It should be noted that older printers and/or port monitor drivers may always return JOB_STATUS_PRINTED information for job status. Your mileage may vary.
Some documentation:
http://support.microsoft.com/kb/158828[^]
Some sample code:
#include <winspool.h>
HANDLE YourClass::OpenDefaultPrinter(ACCESS_MASK dwMask)
{
HANDLE hPrinter = INVALID_HANDLE_VALUE;
PRINTER_DEFAULTS pDef;
DWORD dwSize;
ZeroMemory(&pDef, sizeof(pDef));
GetDefaultPrinter(NULL, &dwSize);
TCHAR* szBuffer = new TCHAR[dwSize];
if(NULL != szBuffer)
{
if(GetDefaultPrinter(szBuffer, &dwSize))
{
pDef.DesiredAccess = dwMask;
OpenPrinter(szBuffer, &hPrinter, &pDef);
}
delete szBuffer;
}
return hPrinter;
}
DWORD YourClass::GetPrintQueCount()
{
DWORD dwNeeded = NULL;
PRINTER_INFO_2 *pInfo = NULL;
DWORD dwRet = 0;
HANDLE hPrinter = OpenDefaultPrinter();
if(INVALID_HANDLE_VALUE != hPrinter)
{
GetPrinter(hPrinter, 2, (LPBYTE)pInfo, 0, &dwNeeded);
if(0 < dwNeeded)
{
pInfo = static_cast<PRINTER_INFO_2 *>(GlobalAlloc(GPTR, dwNeeded));
if(NULL != pInfo)
{
if(GetPrinter(hPrinter, 2, (LPBYTE)pInfo, dwNeeded, &dwNeeded))
{
dwRet = pInfo->cJobs;
}
}
GlobalFree(pInfo);
}
ClosePrinter(hPrinter);
}
return dwRet;
}
Good Luck,
-David Delaune
|
|
|
|
|
How to change rectangle backround of tooltip window to other shape?
|
|
|
|
|
Have a look at TTS_BALLOON.
Beyonf that, do a search here on codeproject for all sorts of tooltip replacements. The built in class is handy, but it runs out of unsefulness VERY rapidly.
Iain,
|
|
|
|
|
ok. Thanks for your reply.
|
|
|
|
|
System: Windows XP / Vista / 32 / 64
Language: C++
I need information about all network controllers
of the PC my application is running on.
(Usually 1 onBoard and 1 additional network card)
And I need their maximum transfer rate
(10MBit, 100MBit or 1GBit)
I already know how to get their IP-addresses
with gethostbyname() and the h_addr_list.
But on that way I don't get any info about their
maximum speed. (maybe the card is a 1GBit controller,
but it is connected with a 100MBit switch...
then the current max. speed should be 100MBit)
Thanks for your help
|
|
|
|