|
Use one of the WIN32 API hook techniques (CodeProject articles), and hook ::TextOut().
|
|
|
|
|
Who the HELL voted this a '2' ? Man, I vote that we should be able to see the names of people who vote on our posts. This is just a joke.
Anyhow, yes, S.Rod has probably given the best advice. Any animation should be double buffered, so you have two images, one that is visible and one you are drawing on. If you hook the GDI calls to put text onto a bitmap, that is probably your best bet to catch this stuff.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Hi, everyone!
In one C/C++ applcation, I think I just need to call WSAStartup once and
not every time when I want to open a socket connection. Before, I call
the function each time in a module of my application which needs network
socket communication. Am I correct?
Thanks in advance,
George
|
|
|
|
|
|
Thanks, Nish buddie!
George
|
|
|
|
|
Hi all, here´s a neat trick i discovered:
If you have Visual C++ 6 and windows XP, you can have VC use the Windows XP
visual styles!!! and i dont mean the apps you writte on it, i mean VC
itself!, this includes the VC dialog editor!, when you are designing a
dialog, you can have all the controls look like windows XP!
there are a few controls that (for some reason unknown to me) still appear
in W9x style, but buttons, list & combo boxes, and (like i said) all
controls you draw on dialog editor (including the dialog itself) look XP
like!
here´s what you do:
-copy the manifest lines below into a new text file (or use the one on MSDN
documentation)
-Rename the text file EXACTLY this: MSDev.exe.manifest
-Put the file on the same folder where the MSDev.exe (VC6 executable) file
is (typically Program Files\Microsoft Visual Studio\Common\MSDev98\Bin)
Thats it!
Note: you MUST put the manifest file on the same folder as the VC executable
or it will NOT work!
Enjoy!!
Here´s the manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="x86"
name="MSDev"
type="win32"
/>
<description>
MSDev Application
</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
|
|
|
|
|
I believe it's worth an article on CodeProject, especially if you can list the limitations and special behaviors.
|
|
|
|
|
I've got an array containing the bitmap image.
How do I save it to make a .bmp file?
Gaurav Gumber
|
|
|
|
|
The term "array containing the bitmap image" is very unspecific.
-Does this bitmap array contains the pixel values only? Or contains the bitmap header as well?
-If it doesn't containg the header, so do you know the it's width and height and what color depth is used?
-Is the array bytes aligned to DWORD, i.e. padding zeros is added to the end of each horizontal scan to be divisible by 4?
Give me these details and I could help you.
|
|
|
|
|
How can I add an "OK" button, three "Text" lines and play an AVI in a window created by API as below in a Microsoft C 6.0 to be run in Win98?
DLLEXPORT int _stdcall Test(unsigned char * key)
{
const char g_szClassName[] = "myWindowClass";
RECT rcClient; // client area of parent window
int cyVScroll; // height of scroll bar arrow
HWND hwndParent; // handle of parent window
HWND hwndPB; // handle of progress bar
HWND hwndAVI; // handle of avi
int i;
WNDCLASSEX wc;
// Register the Window Class
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = g_hInstance;
wc.hIcon = 0;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW);
wc.lpszMenuName = NULL;
wc.lpszClassName = g_szClassName;
wc.hIconSm = 0;
if(!RegisterClassEx(&wc)) {
MessageBox(NULL, "Window Registration Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
// Create the Window
hwndParent = CreateWindowEx(
WS_POPUPWINDOW,
g_szClassName,
"Encryption in Progess",
WS_OVERLAPPEDWINDOW & ~WS_MINIMIZEBOX & ~WS_MAXIMIZEBOX & ~WS_THICKFRAME,
GetSystemMetrics(SM_CXSCREEN)/3, GetSystemMetrics(SM_CYSCREEN)/3,
GetSystemMetrics(SM_CXSCREEN)/3, GetSystemMetrics(SM_CYSCREEN)/3,
NULL, NULL, g_hInstance, NULL);
if(hwndParent == NULL) {
MessageBox(NULL, "Window Creation Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK);
return 0;
}
ShowWindow(hwndParent, SW_SHOWNORMAL);
UpdateWindow(hwndParent);
GetClientRect(hwndParent, &rcClient);
cyVScroll = GetSystemMetrics(SM_CYVSCROLL);
hwndPB = CreateWindowEx(0, PROGRESS_CLASS, (LPSTR) NULL,
WS_CHILD | WS_VISIBLE | PBS_SMOOTH,
rcClient.left + cyVScroll, (rcClient.bottom - 2*cyVScroll),
(rcClient.right - 2*cyVScroll), cyVScroll,
hwndParent, NULL, g_hInstance, NULL);
// Set the range and increment of the progress bar.
SendMessage(hwndPB, PBM_SETRANGE, 0, MAKELPARAM(0, 4000));
SendMessage(hwndPB, PBM_SETSTEP, (WPARAM) 1, 0);
for (i = 0; i < 4000; i++)
// one small step of lengthy operation
SendMessage(hwndPB, PBM_STEPIT, 0, 0);
DestroyWindow(hwndPB);
return 0;
}
|
|
|
|
|
Hey All,
Can anyone point me towards a tutorial and/or sample code on sending rtf formatted email. I have to send a small 10 row by 4 column table every morning. Right now I am using Simple MAPI to send it, but it is totally unreadable unless viewed with a fixed width font.
Any help appreciated.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
It's because you can't directly. Watch out TNEF in MSDN (OpenTnefStream, WrapCompressedRTFStream, ...). It's what is used by Outlook by the way.
|
|
|
|
|
Can't you just send it as an attachment?
Regards,
Rohit Sinha
|
|
|
|
|
Hi, does anybody know (can tell us/point us to source code/docs) how to change keyboard mappings for the whole system. Eg. say we want to have Ctrl-K act as if someone pressed the Down Arrow. Can we intercept keyboard messages for the whole system, and then change them before other applications receive them?
thanks in advance
|
|
|
|
|
I suppose you could write a filter and attach it to the driver stack. That way you could modify the IRP before it reaches the RIT. Take a look at kbfiltr in the DDK. There is also another another similar solution at www.sysinternals.com (ctrl2cap), but kbfiltr seems to give you more freedom to manipulate the entire buffer, like inserting keystrokes.
BTW, I will probably have to write something similar in a couple of weeks, so if you find another way I'd be glad to hear about it...
/moliate
The corners of my eyes catch hasty, bloodless motion -
a mouse?
Well, certainly a peripheral of some kind.
Neil Gaiman - Cold Colours
|
|
|
|
|
Rather than using the driver idea (which would work, but is yeuch), you could look at
SetWindowsHookEx (WH_KEYBOARD/WH_KEYBOARD_LL, ...) which can be used for your purpose. Just a search
in MSDN gives many examples.
(And you can debug it more easily!)
Iain.
|
|
|
|
|
I want to Create a Frame/view/doc structure On a ActiveX Control,but It will be Found Memory leak! And I Found that the
reasons is :
CDocManager* CDocManager::pStaticDocManager;
CPtrList* CDocManager::pStaticList;
How Can I avoid Memroy leak?
the Following is My Code :
BOOL Create()
{
if( m_pFrameWnd )
{
if( IsWindow(m_pFrameWnd->m_hWnd) ) return TRUE;
}
CSingleDocTemplate * pDocTemplate;
pDocTemplate = new CSingleDocTemplate(IDR_MAPTYPE,
RUNTIME_CLASS(CMapDoc),
RUNTIME_CLASS(CMapFrame),
RUNTIME_CLASS(CMapView));
// pDocTemplate in destructor function delete this!
CMapDoc * pDoc = new CMapDoc;// in destructor function delete this!
CCreateContext Context;
Context.m_pCurrentDoc = pDoc;
Context.m_pNewDocTemplate = pDocTemplate;
Context.m_pNewViewClass = RUNTIME_CLASS(CMapView);
Context.m_pLastView = NULL;
Context.m_pCurrentFrame = NULL;
CMapFrame * pFrameWnd = new CMapFrame;// in destructor function delete this!
m_pDoc = pDoc;
m_pFrameWnd = pFrameWnd;
m_pDocTemplate = pDocTemplate;
CRect rcMap;
GetClientRect(&rcMap);
BOOL ret = m_pFrameWnd->Create(AfxRegisterWndClass(CS_DBLCLKS), NULL, WS_CHILD|WS_VISIBLE, rcMap,this,NULL,&Context);
m_pFrameWnd->ShowWindow(SW_SHOW);
return ret;
}
ZHANGYIFEI
|
|
|
|
|
Hello,
I wrote a Windows-Application (not a console applic.)
If I start it in a Console (DOS-Windows in Win98/NT),
so I can give commandlines for example:
"mywinprog.exe var1 var2 var3", it's works fine.
So I can start the winprog with a batchfile ( example.bat in a console ).And for any result, I send ReturnValues from "mywinprog.exe" .
My Problem:
I want to write a String/Text into this console, where I start the mywinprog.exe.
How can I do this ???
The API Funct. is : WriteConsole(handle, text, strlen (txt),0,0), but if I use the GetStdHandle(STD_OUTPUT_HANDLE), I receive value NULL.
With API FindWindowEx(..), I could'nt find the console.
|
|
|
|
|
Hi,
I have a table in MS Access that has Date(short Date) and Time(short Time) fields. I have a CRecordSet object that is to be mapped to the fields of that table.
My questions:
1. What should be data type of the variables in CRecordSet object, to be mapped to corresponding Date and Time fields in MSACCESS.
2. How to retrieve values from these variables. How to use them if they are COleVariant variables.
Help from any one will be appreciated.
Adnan.
|
|
|
|
|
Here's the scenario...
I've a VB project that uses COM objects & also opens an ADO database connection. When the app is shutdown, it just hangs... if i try attaching the debugger to the process, i get the dreaded "DM0025 - Error attaching to process" msg taking down the process that i want to debug
What is also strange about the behavior is that if i dont open an ADO database connection, then the app shutsdown cleanly. I've to mention that the COM object also connects internally to an Oracle database.
How do you go about debugging this behavior?
Any pointers would be appreciated. TIA
Chen Venkataraman
|
|
|
|
|
1. try to attach before shutdown
2. check that you have admin permissions
3. do not use Oracle
|
|
|
|
|
Hey, I posted this before wondering how I could shut down an external program. I am trying to shutdown kazaa and I learned that all I had to do was send the WM_CLOSE command to it.
Now, this would work on most normal programs but Kazaa is in the system tray so instead of closing Kazaa it just "minimizes" it into the tray. If I send the message a second time then it maximizes again. How can I shut it down completely? Thanks for any help.
|
|
|
|
|
Use Spy++ to find out the ID of the message that Kazaa uses to close when you select the close function from the right click menu when it is minimized to system tray.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"AAAAAAAAAHHHHHH!!!!! Those leaks are driving me crazy! How does one finds a memory leak in a garbage collected environment ??! Daniel Turini Nov. 2, 2002.
|
|
|
|
|
Wow, never heard of Spy++ before but thats a great tool. Anyway I found the messages to be WM_DESTROY and then it also called WM_NCDESTROY. Now I have the button call these messages when its pressed but it says that "Kazaalite has performed an illegal operation." The program closes fine but is there anyway I can shut it down without this happening?
|
|
|
|
|
WM_DESTROY and WM_NCDESTROY are messages sent by Windows when it is closing a Window. They aren't messages you can send to a window to make it close.
Instead, try sending a WM_SYSCOMMAND message, with wParam=SC_CLOSE and lParam=0 . This tells the application to close the window.
Software Zen: delete this;
|
|
|
|
|