|
hi there,
i have a problem. now i am developing an application for our client. One of their requirements is that they want to control page numbers, e.g. the maximum page number is 5, when their users print documents, using MS office familiy, such as Word. How should i do?
Thanks a lot in advance.
Evisoh
|
|
|
|
|
If they are printing directly from Word, you can't control how many pages they print. You can, however, provide your own interface and use Word automation to print the document. Then you can control how many pages are requested.
|
|
|
|
|
unfortunately, they have to print directly from word. I suppose that i can use Hook to intercept printing message, however, i have not seen yet any articles about how to intercept printing message. If you guys knew this, i will appreciate your suggestion.
|
|
|
|
|
hu_jia wrote:
unfortunately, they have to print directly from word.
Then why limit them? What good does it do to have a product if you only want part of it to be used?
|
|
|
|
|
that is a human resource center, and every single their user can get maximum 5 pages of printouts. now it is managed by staff, and keep them very busy because of lots of peopel out there. that's why they want to get it controled by compnters.
|
|
|
|
|
Given that they have full control over Word, I see no solution. Not knowing everything from your vantage point, what I've got so far would dictate giving them a little printing utility that limited the number of pages to five. Good luck.
|
|
|
|
|
i will negotiate with them to find alternative if we find no solution. Anyway, thanks a lot. let's keep in touch.
|
|
|
|
|
Can anyone advise me on how to make my console program start minimized?
Thanks all
Digital Khaos
"Diplomacy is dead. Feel my wrath!"
|
|
|
|
|
Here is a good starting point:
http://www.codeproject.com/cpp/cppforumfaq.asp#cons_nowindow
|
|
|
|
|
Ok, I appologize for not reading the FAQ. However, how about make the window non-closeable by the user. graying out the X, or something similiar. Is this an administrative function, or can it be done in code?
Thanks again.
Digital Khaos
"Diplomacy is dead. Feel my wrath!"
|
|
|
|
|
Here's one solution for disabling the Close button:
#include <tchar.h>
BOOL CALLBACK EnumWindowsProc( HWND hwnd, LPARAM lParam )
{
TCHAR a_szClass[64] = {0};
::GetClassName( hwnd, a_szClass, 63 );
if( !_tcsicmp( a_szClass, _T("ConsoleWindowClass") ) )
{
DWORD a_dwWindowThread = ::GetWindowThreadProcessId( hwnd, NULL );
if( a_dwWindowThread == ::GetCurrentThreadId() )
{
*((HWND*)lParam) = hwnd;
return FALSE;
}
}
return TRUE;
}
void RemoveYourConsoleCloseButton()
{
HWND a_hThisConsoleWindow = NULL;
::EnumWindows( EnumWindowsProc, (LPARAM)&a_hThisConsoleWindow );
if( a_hThisConsoleWindow )
{
HMENU a_hMenu = ::GetSystemMenu( a_hThisConsoleWindow, FALSE );
if( a_hMenu )
{
::RemoveMenu( a_hMenu, SC_CLOSE, MF_BYCOMMAND );
::SetWindowPos( a_hThisConsoleWindow, NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_DRAWFRAME );
}
}
}
When you want to disable the close button, call RemoveYourConsoleCloseButton().
Chris Richardson
You can stash and you can seize
In dreams begin, responsibilities U2 - Acrobat[^]
Stop being PC and accounting for everyone and his momma's timeframe. Just enjoy your - Rohit Sinha in the content-challenged thread
|
|
|
|
|
I would like to write a graphical utility that performs similar trouble shooting functions to the Microsoft utility BROWSTAT.EXE. Can anyone point me in the right direction of material about Windows API functions that can be used? I have several books, MSDN, on-line resources, etc. The only Windows Browsing API functionality I am able to find involves enumerating browse lists. I am hoping to be able to programmatically get/set domain master browsers, manage browse lists, etc… I assume there are API functions that do these things because BROWSTAT and BROWSEMON do. Please help. Thanks.
|
|
|
|
|
The WMI (Windows Management Instrumentation) API should be more than enough (and I guess it's the only way as well) to get the work done. Beware though it's a bit cryptical and has thousands of objects depending on implementation, which might be confusing at first look.
|
|
|
|
|
I'm seeing some strange display problems with CCheckListBox on Win2000.
I have an MFC app which displays a CCheckListBox. The app has been compiled on an XP machine using VS.NET (2002) but with no manifest or theme code. On XP machines the CCheckListBox displays its contents no problem. (Three strings). However on Win2k machines the entries aren't displayed. However if I click on the list box then the items are there, just not being displayed.
Anybody seen this problem before?
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
If I remember well, you have to programatically select one item to have them displayed in the list box, inserting is not enough.
~RaGE();
|
|
|
|
|
Hi all,
My applicaiton needs to look for and use a currently open IE (Using IE 6) and if there's not one, then start one. The problem I'm having is that GetActiveObject will see other programs such as Excel and Word, but it always fails to see IE running. I've tried both the CLSID_InternetExplorer and using the CLSIDFromProgID function. Neither seen to work. I've also read that some Office programs need to loose focus before they register running objects, but that does not seem to help in this case either. Any ideas? Is there something with IE that I'm not setting? Can CoCreateInstance or CoGetClassObject be used to detect? Thanks for any info. -rob.
HRESULT hr;
hr = ::CLSIDFromProgID(L"IExplorer.Application",&prog_clsid);
assert(SUCCEEDED(hr));
hr = ::GetActiveObject(prog_clsid, NULL, &pUnk);
// hr = ::GetActiveObject(CLSID_InternetExplorer, NULL, &pUnk);
assert(SUCCEEDED(hr));
|
|
|
|
|
I just tried that code but used "InternetExplorer.Application" for the ProgID, and it worked fine for me
Chris Richardson
You can stash and you can seize
In dreams begin, responsibilities U2 - Acrobat[^]
Stop being PC and accounting for everyone and his momma's timeframe. Just enjoy your - Rohit Sinha in the content-challenged thread
|
|
|
|
|
Hi
I have made a new form, derived from CDialog, i've already implemented contextual help ('What is this?').
But i don't seem to be able to get a question mark icon in the title bar of that form. It can't be hard, but i don't find it
Anyone knows?
Greetings
Jens
|
|
|
|
|
Check the Context help checkbox on the Extended Styles tab of the Properties dialog.
|
|
|
|
|
yes it is checked but it doesn't give me the arrow icon on title bar.
|
|
|
|
|
Arrow icon? Do you mean a question mark? According to the documentation, the Context help checkboxes on both the More Styles and Extended Styles tabs are directly related to the question mark in the title bar of the dialog.
|
|
|
|
|
yeah i meant the question mark.
And yes, i checked those 2 already.
But i still don't see it
|
|
|
|
|
I'm at a loss at this point. Perhaps you could create a test application that sports one dialog box. Play with those two "help" checkboxes and then see how the test application differs from the application that does not work.
|
|
|
|
|
The context help style can't be used if the dialog has minimize and/or maximize buttons.
--Mike--
Yeah, payin' the bills with my mad programming skillz.
Defraggin' my hard drive for thrills.
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
the problem was i had to enable 'system menu' in Dialog properties. Now i have the context help style with a 'X' close button next to it .. can i hide the 'X' (close) button and still having the context help style?
Greetings and thanks for the fast response
Jens
|
|
|
|