|
::keybd_event(VK_SNAPSHOT,0x45,KEYEVENTF_EXTENDEDKEY|0,0);
use this api to get snapshot.
and getting that image into your Application you have to querry Clipboard like this
//paste
HANDLE hBitmap=NULL;
if (OpenClipboard()) hBitmap=GetClipboardData(CF_BITMAP);
CloseClipboard();
and you got the image handle in hBitmap var
I Think It will Work
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
what if, i don't want to press a key?! coz, i want to make it automated... thanks for the info!!!
|
|
|
|
|
i have this application(exe) which is running.Now i want to develop another application in VC++ that can handle the the events that are happening inside the former.how can i do this ? can anybody help ?
thanks
sriraag
|
|
|
|
|
Microsoft wrote:
Although many of the filters provided with DirectShow support property pages, they are intended for debugging purposes, and are not recommended for application use. In most cases the equivalent functionality is provided through a custom interface on the filter. An application should control these filters programatically, rather than expose their property pages to users
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directX/htm/introductiontodirectshow.asp
Does anyone know how to "control these filters programatically"? Or where can I find a sample or documentation on the topic?
Very appreciate for any kind of help. Thanks.
|
|
|
|
|
|
|
hai,
I want to attach a bitmap to my button control.I'm using win32 vc++ and I am just the beginner to vc++. I used loadbitmap() and sendmessage() to button control.It worked.But I was requested to do with subclassing. I pretty much have no idea.I tried MSDN. It's there for MFC (subclassdlgitem())but I want to do in win32.Can anyone help me?
|
|
|
|
|
Subclassing in Win32 requires that you write your own window procedure (see WindowProc in MSDN) and specify it as the lpfnWndProc parameter in the WNDCLASS structure you use to register your window class. You use the class name you used in the WNDCLASS structure in your call to CreateWindow when you want to create your button.
see MSDN for: WindowProc, WNDCLASS, RegisterClass, CreateWindow.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
You can try to do something like this....
<br />
WNDPROC wpOrigButtonProc; <br />
<br />
LRESULT APIENTRY DlgProc(<br />
HWND hwndDlg, <br />
UINT uMsg, <br />
WPARAM wParam, <br />
LPARAM lParam) <br />
{ <br />
HWND hwndButton; <br />
<br />
switch(uMsg) <br />
{ <br />
case WM_INITDIALOG: <br />
hwndButton = GetDlgItem(hwndDlg, ID_BUTTON); <br />
<br />
wpOrigButtonProc = (WNDPROC) SetWindowLong(hwndButton, <br />
GWL_WNDPROC, (LONG) ButtonSubclassProc); <br />
return TRUE; <br />
<br />
case WM_DESTROY: <br />
SetWindowLong(hwndButton , GWL_WNDPROC, <br />
(LONG) wpOrigButtonProc); <br />
break; <br />
} <br />
return FALSE; <br />
UNREFERENCED_PARAMETER(lParam); <br />
} <br />
<br />
LRESULT APIENTRY ButtonSubclassProc(<br />
HWND hwnd, <br />
UINT uMsg, <br />
WPARAM wParam, <br />
LPARAM lParam) <br />
{ <br />
switch(uMsg)<br />
{<br />
case ....<br />
<br />
}<br />
<br />
return CallWindowProc(wpOrigButtonProc, hwnd, uMsg, <br />
wParam, lParam); <br />
} <br />
I hope this helps you out.
|
|
|
|
|
hai,
Thanks a lot.I understood your code.But inside this subclass procedure what I should do to attach my bitmap to the button?
thanks.
|
|
|
|
|
Well catch WM_PAINT or something and use StretchBlt or BitBlt to draw the image in the button window. You will have to check if WM_PAINT is the most appropriate message to use here...
|
|
|
|
|
Hi Guys,
Iam working on an Mfc Project & have to use the VsflexGrid Control(Videosoft FlexGrid -version 8,lightunicode).Have some questions regarding that & would be nice if someone could clarify it stating the exact member function to use.
[1] Have 1 Fixed Column & 1 Fixed Row,in Which I intend to enter some user Labels.
How can I enter text("Userlabeltext") in a particular cell in a fixed column or row.
Can I use the same function for entering "text" in other cells also(In non Fixed Rows & Columns).
[2]Have a row in which I have 3 cells.
In the 1st cell,I want to have a Editable ComboBox.(ie: user should see the populated combobox as well as he can type something,which would be saved & populated later in the combo).
[a] How Can I put a combobox in a particular cell inside a VsFlexGrid control.
[b]How can I populate the combobox.
[2A]In the 2nd cell,I want to have a Non-Editable ComboBox,where only populated things in the combox box should be displayed.The user is not allowed to type anything in the combobox.(Is it possible to insert a ListBox here instead of a combo).
How can I do this(either list or combo)
[2B] In the 3rd cell,want to have a checkbox.How Can I put a checkbox in this cell.
[2C] In the 4th cell,I want to have a editable textbox.
[a] How can I populate the textbox with the defaultvalue.
[3] How can I change the Font of a Text,in the fixed row & column
So Thanks..........
|
|
|
|
|
Hi All,
I need to develope a filter driver in 2000.
At the driver level, i need to know which files are opened, read, written and closed.
While i try to do this, Iam not able to get the full file name.
I mean, iam getting the file name without the Drive Name.
Eg.
If the file opened is C:\New\xx.txt, Iam getting the file name as \New\xx.txt.
Iam getting this info from File_Object's filename.
Also, for a mapped drive iam getting the drive name properly!
How to get the drive name correctly for other drives?
With Regards,
A.Ilamparithi.
|
|
|
|
|
Hi,
How do I secure access database file. I have an application written in vc++. When the database is opened, I want to prevent the file being viewed by MS-access or make a copy of the file. Is it possible??
VYJU
|
|
|
|
|
Open the database using Access. On the Tools menu, select Security, and then Set Database Password. Now no matter how it is opened, a password must be supplied. The .MDB file can be copied from outside of Access, however. To prevent this, an OS-level security setting would be required.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
HI,
Wt meassge is generated on window maximmize.
and how it can be handled ....n where ...
any idea .. assume that i want to show a MessageBox
when window is Maximize after minnimizing.
any code or help;
thanx
|
|
|
|
|
catch WM_SIZE in simple SDK or OnSize in MFC and they receive
SIZE_MAXIMIZED
The window has been maximized.
SIZE_MINIMIZED
The window has been minimized.
and other messages....
check MSDN....
|
|
|
|
|
thanx it worksss
Can u answer mine question below here in fourm abut Slider Control
thanx
|
|
|
|
|
HI,
I build my own Video file player.
Now wanaa use CSliderCtrl that will move onwards as the file runs ,,, same as in Windows media player
i looked in code project but this kind of sample not
there.
any sample .. or help code
thanx
|
|
|
|
|
Can you get the timeline of the file?
Then you can synchronize your slider with this.
(adjusting the position every second or something)
you can also try every # of frames of your video. (eg. every 5 frames set next position etc...)
Just ideas hope they help.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
hi,
I have created a Bmp object using GDI+.
Bitmap bmp(400,500);
Now I want to save this Object as Gif File with Different Color Palette.I know that we can save the Gif file like this..
CLSID imageClsid;
GetEncoderClsid(L"image/gif", &imageClsid);
bmp.Save(wst, &imageClsid, NULL);
BUT I want to save the bmp as gif file with DIFFERENT COLOR PALETTE.How do I do that.....
please help me..
|
|
|
|
|
Hi all,
a couple of questions
1)When my process is terminated, say from the taskmanager, what is the callback message I need to use?
2)I assume if my process is being terminated because of a system shutdown I would use WM_ENDSESSION, is this correct?
Thanks again for all your help,
you guys are the greastest,
-bacon
|
|
|
|
|
AmericanBacon wrote:
When my process is terminated, say from the taskmanager, what is the callback message I need to use?
If your process is terminated from taskmanager you don't get any notification at all.
AmericanBacon wrote:
I assume if my process is being terminated because of a system shutdown I would use WM_ENDSESSION, is this correct?
Yes.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I can't believe it. The following line of code takes 30 seconds or more to finish. It does not happen all the time, which is even worse. For most of the time, everything just work fine. But once in a while, the program freeze for half a minute or more. The program log tells that it block at the following line. The worst thing is that I cannot reproduce the problem in my deveoping environment. It just happen on the customer's machine
HICON h = (HICON)LoadImage(0,strFile, IMAGE_ICON, nWidth, nHeight, LR_LOADFROMFILE);
Anybody can help me?
|
|
|
|
|
LoadIcon being a single API-call can hardly have anything to do with this. As much as I hate it in a support situation, this ought to be a problem with the user machine. A further investigation of indexing services, check of background processes, harddisk surface check etc. will probably be more fruitful than staring at the offending line. You might want to check so that the load is made as seldom as possible in your code, however. For example, preloading the icon in a ctor rather than in OnPaint .
|
|
|
|