|
Hi ALeyner,
i am searching for sample as how to customize the header/footer for the web page print content. Can u plz send me ur code for my understanding as how to implement the print template for customizing the header/footer of the web page while printing. It will be very useful .plz send me ur code.
|
|
|
|
|
since windows draw it for , i counldn't find any way to avoid it when i was creating my own ownerdrawn menu...
any1?
thanks in advanced
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
What about putting a bitmap there?
hope you are aware about drawing triangles using PolyLine method or MoveTo, LineTo combination in GDI. All you need to specify the cordinates... You can adopt that method.
Another tweak is that
using lines you can draw a pooup triangle.
Here I have drawn a triangle using three lines. Assume that each "|" represents a pixel and each column with "|" represents a line.
You can use this method.
|
||
|||
||
|
Sorry no time to write code for the same
-Sarath.
The more you can dream the more you can do - Michael Korda"
|
|
|
|
|
i can draw what ever i want, the problem is that after the 'DrawItem' is finished, windows calls its own methods to draw the arrow by itself, so it overwrite my drawings...
anyway to bypass this problem?
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Just subclass the menu and handle your own painting.
|
|
|
|
|
subclass as in inherite a class from CMenu and implement DrawItem?
if this is what you suggest, i've already done that, and still the problem remains, because after draw item, windows draw the arrows itself....
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
No, subclass and implement a handler for WM_PAINT.
Steve S
Developer for hire
|
|
|
|
|
I used the following trick:
At the end of your DrawItem(), just before returning, set an empty clipping region. This will effectively prevent Windows from drawing over your arrow.
At the beginning, reset the clipping region to ensure you can draw back.
Code:
void CMyMenu::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
pDC->SelectClipRgn(NULL);
pDC->IntersectClipRect(0,0,0,0);
}
|
|
|
|
|
Sounds interesting, will try it
thanks a lot man
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
I wrote a DLL that should serve as interface to an usb-device so that it could handle different requests from different applications. The idea was that the DLL could synchronise all requests and the device should be opened only once.
The problem with this is that although i can use some shared memory between all instances using the DLL, I can't find the good solution for the single HANDLE to my file/device.
I tried starting a thread from the first instance that would hold the handle and all instances would talk with this thread, but then the problem comes when this first instance dies it takes the thread down with it ...
I also tried using two dll's. I thought I could load the 2nd dll from within the first one so that all instances of the first dll would communicate with only one instance of the second dll, but that ain't working either.
At this moment I only can get it to work if every instance/request opens and closes the handle of the file/device over and over again, but that doesn't seem the nice way to me.
So basically my question is this: How can I keep one handle of a file in a dll so that every call made to this dll can use this handle ?
Any help would be welcome thanks
|
|
|
|
|
HANDLE s are only valid within one process, unless you explicitly make a copy with DuplicateHandle() and pass the resulting handle value to another process.
|
|
|
|
|
Thx for the help ...
I don't see how I can get it to work as GetCurrentProcess() (which i need to retrieve the process handle) returns 0xffffffff from within my dll.
Any suggestions ?
|
|
|
|
|
That's the correct vaule, GetCurrentProcess() returns a pseudo-handle that other functions interpret to mean "the current process"
|
|
|
|
|
Hi All,
I have a application, say A.exe. It launches another application, say B.exe. In B.exe i need to know the identity (pid, process name) of calling application.
Is there any way by which I can do it?
Thanks,
Suraj
Suraj Gupta
|
|
|
|
|
|
Hi,
Thanks for the reply but the link did not help.
-Suraj
Suraj Gupta
|
|
|
|
|
When you run B.exe what happen for A.exe its close?
|
|
|
|
|
You can read detaily from a.exe and use WM_COPYDATA for send this data to B.exe
|
|
|
|
|
If you have handle two A.exe window, you can use GetWindowThreadProcessId .
|
|
|
|
|
Hi,
I don't have the handle of A.exe window.
-Suraj
Suraj Gupta
|
|
|
|
|
Gupta Suraj wrote: I don't have the handle of A.exe window
What do you mean by this. Is that process is windowless ?
|
|
|
|
|
No, Exe is not windowless. Exactly the problem is that "A.exe" which is parent process, it can change mean 'A'can take any name. So i have to identify the name of the application. On that basis logic of my application will be based.
Suraj Gupta
|
|
|
|
|
Gupta Suraj wrote: Exactly the problem is that "A.exe" which is parent process, it can change mean 'A'can take any name. So i have to identify the name of the application
You need some information of process, i.e. name etc. to get its PID.
See if this[^] example helps you?
|
|
|
|
|
Couldn't you just provide them as command line arguments to B, or do you not have any control over how A invokes B?
|
|
|
|
|
I don't have the control, how A invokes B.
Suraj Gupta
|
|
|
|