This is a discussion on Visual C++ Tips & Tricks within the C and C++ Programming forums, part of the Software Development category; Hi, using the following win32 API we can find Multiple VGA card in Display. EnumDisplayDevices() .......... thanks...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#51
| |||
| |||
| Hi, using the following win32 API we can find Multiple VGA card in Display. EnumDisplayDevices() .......... thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#52
| |||
| |||
| Hi, I need: Get Handle of Main Window from process handle. Here is the answer.... 1. - Use GetProcessId() to get process id from process handle. Use EnumWindows() to look at each top-level window. For each top-level window call GetWindowThreadProcessId() to get the thread id and process id that was used to create the window. Break when you find a top-level window that was created by the specified process handle/id. 2. - Use GetWindowThreadProcessId() to get the thread id and process id that was used to create the window. ........... thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#53
| |||
| |||
| Trapping Windows Shutdown and Cancel the shutdown... Hi, Use WM_QUERYENDSESSION for system shutdown in WndProc system function. When that message is received, return 0, pass the WM_CANCELMODE message to that window message and then shutdown on your own by using ExitWindowEx Api . ................ thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#54
| |||
| |||
| To change attributes for a directory if (! SetFileAttributes("c:\\ResOrg",FILE_ATTRIBUTE_READ ONLY))................ thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#55
| |||
| |||
| Using multiple resource... Hi , Here I am giving the tips for using multiple resource (*.rc) in your Visual C++ project steps 1) Goto menu view-> Resource Includes 2) Resource Includes Window will be open. In that add #include "yourRes.rc" in the Compile - time Directives: textbox 3) Edit the main resource file and add #include yourRes.h behind the #include "afxres.h"now your resource file will be linked .......... thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Booom : 08-09-2007 at 04:46 AM. |
|
#56
| |||
| |||
| To get the Cursor (X,Y) position in PreTranslateMessage add the following code. POINTS pts = MAKEPOINTS( pMsg->lParam );in the mouse message trapping like WM_LBUTTONUP ,WM_MOUSELEAVE etc. thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#57
| |||
| |||
| Change the color of the VC++ IDE... by changing the registry values, we can change the color of the Visual C++ IDE... [HKEY_USERS\.Default\Software\Microsoft\Devstudio\6 .0\Format\Source Window] "FontFace"="Comic Sans MS" "FontSize"=dword:00000009 "Text"=hex:c0,80,c0,00,00,00,00,00,12,01,b2,00 "Text Selection"=hex:00,00,00,00,c0,80,c0,00,19,00,19,00 "Current Error/Tag"=hex:ff,ff,ff,00,00,00,80,00,d2,01,b2,01 "Bookmark"=hex:00,00,00,00,00,ff,ff,00,10,00,1 0,00 "Breakpoint"=hex:ff,ff,ff,00,80,00,00,00,10,00 ,10, 00 "Current Statement"=hex:00,00,00,00,ff,ff,00,00,70,00,70,00 "Selection Margin"=hex:d8,e0,f0,00,d8,e0,f0,00,13,00,13,00 "Keyword"=hex:00,ff,00,00,00,00,00,00,10,00,10 ,00 "Comment"=hex:ff,ff,00,00,00,00,00,00,10,00,11 ,00 "Number"=hex:ff,00,00,00,00,00,00,00,10,00,11, 00 "String"=hex:ff,00,00,00,00,00,00,00,10,00,11, 00 "Operator"=hex:00,ff,00,00,00,00,00,00,10,00,1 1,00 "Wizard IDL/ODL Code"=hex:80,80,80,00,00,00,00,00,14,00,15,00 "HTML Element Name"=hex:c0,80,c0,00,00,00,00,00,14,00,15,00 "HTML Attribute Name"=hex:00,ff,00,00,00,00,00,00,14,00,15,00 "HTML Attribute Value"=hex:ff,00,00,00,00,00,00,00,14,00,15,00 "HTML Comment"=hex:ff,ff,00,00,00,00,00,00,14,00,15,00 "HTML Entity"=hex:ff,c0,40,00,00,00,00,00,14,00,15,00 "HTML Tag Delimiter"=hex:00,ff,00,00,00,00,00,00,14,00,15,00 "HTML String"=hex:ff,00,00,00,00,00,00,00,14,00,15,00 "HTML Tag Text"=hex:ff,00,ff,00,00,00,00,00,14,00,15,00 "HTML Operator"=hex:00,ff,00,00,00,00,00,00,14,00,15,00 "HTML Server-Side Script"=hex:00,00,00,00,ff,ff,00,00,14,00,14,00 "Wizard Code"=hex:80,80,80,00,00,00,00,00,14,00,15,00 "User Defined Keywords"=hex:00,00,ff,00,00,00,00,00,14,00,15,00 ........... thanks
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Booom : 08-09-2007 at 04:46 AM. |
|
#58
| |||
| |||
| Hi, here is another tips, When debugging, you can single step into functions by pressing F11. To break the debugging, press Ctrl+F5(this is to run the same application for debugging) thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#59
| |||
| |||
| Hi, #include<windows.h> int_stdcall WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpszCmdLine,int nCmdShow) { MessageBox(0,"HELLO","TITLE",0); return 0; } This program is not running it produces an error syntax error : missing ';' before identifier 'WinMain' error C2501: 'int_stdcall' : missing storage-class or type specifiers fatal error C1004: unexpected end of file found Error executing cl.exe. How to I solve it. Last edited by roboeinstein : 08-20-2007 at 09:22 AM. |
|
#60
| |||
| |||
| Hi, I hope you have started VC application wrongly. Here is the steps to run the WinMain. It is a Win32 Application. Follow the steps 1. New Project -> In Project tab, select Win32 Application 2. In your source code file for en example, if you started the project as test, then edit "test.cpp" 3. Add your Message box. #include "stdafx.h"thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Karpagarajan : 08-21-2007 at 01:09 AM. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C# .Net Tips & Tricks | oxygen | C# Programming | 85 | 01-08-2009 12:25 AM |
| SAP Tips & Tricks | leoraja8 | Operating Systems | 0 | 03-29-2008 12:11 AM |
| Visual Studio Tips & Tricks | SaravananJ | C# Programming | 197 | 12-20-2007 03:25 AM |
| PHP Tips and Tricks | Sabari | PHP Programming | 20 | 12-18-2007 05:26 AM |
| .NET tricks & Tips | Karpagarajan | VB.NET Programming | 1 | 04-23-2007 08:17 AM |
Our Partners |