|
I've never actually used it myself, but the WM_PRINT and WM_PRINTCLIENT messages are supposed to do this. The trick is the window in question has to handle those messages.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Hi,
I am working on a object based graphic editor that's implemented using CView class. I am thinking of adding a text object where user can edit the text directly on screen. It will function like the text tool in MSPaint. Any one has any idea on how to implement this?
Thanks
Chun
|
|
|
|
|
the easiest way is to just show a small edit control at the place where you want to edit the text, then hide it when you're done - a bit like what Explorer does when you want to change a filename.
|
|
|
|
|
Hello.
I am new to DLL programming but I do know the basics (injection, creation).
Lets say I make a windows application in MS VS.Net 2003. The application just contains a simple textbox.
Now, how would i access this textbox from my dll? I want to change for example the textbox backcolor. Do I need to know the textbox name to do this? Or maybe this is impossible?
Thx in advance
|
|
|
|
|
Through the WM_DRAWITEM message I can get to the DRAWITEMSTRUCT hence it’s hdc member provides a handle to a device context. Then, having access to device context what function or procedure if any could lead me to the lpString Parameter of an ExtTextOut function that holds the Pointer to a string that specifies the text to be drawn in a List View Control?
p.s.
bearing in mind that since, ExtTextOut offers a handle to the device text then the reverse should also be true or NOT?
|
|
|
|
|
NOT, you can't give something to a function then later ask for it back. You should make a copy of the string the first time you use it. After sending it to the ExtTextOut, it is no longer a string, but a collection of pixels in the DC.
|
|
|
|
|
Hi,
I am successfully using the PropertySheet() function with the PSH_WIZARD97 flag. All is working fine.
But when i try to set the Next/Prev/Finish/Cancel/Help buttons to ownerdraw then it does not work!
To clarify: I successfully set those buttons to ownerdraw state when using not the Wizard97 flag - means when using a normal property sheet.
But when defining the PSH_WIZARD97 flag the buttons are not ownerdrawn anymore.
However, i still can change the size and the labels of those buttons.
How/when i am doing this: I am using the callback function and on PSCB_INITIALIZED i am accessing those buttons:
For example, to set another text for the Help button i do the following:
SendMessage(GetDlgItem(hDlg, IDHELP), WM_SETTEXT, NULL, (LPARAM)(LPTSTR)szNewLabel);
But when setting the ownerdrawn flag, it seems to either get ignored or overwritten. I do it the following way:
DWORD dwStyle = BS_OWNERDRAW|WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN;
SetWindowLong(GetDlgItem(hDlg, IDHELP), GWL_STYLE, dwStyle);
Again - if i remove the PSD_WIZARD97 flag, then the button is ownerdrawn... but then i have a normal property sheet and i want that wizard interface.
Does anybody know a solution?
Thank you
Nikolaus
|
|
|
|
|
Hi!
I use completion port for asynchronous communication over named port. The one program sends to named port only one type of messages. The other program has 3 threads which each gets 5 asynchronous requests from named port (using completion port). Then each thread gets one message through GetQueuedCompletionStatus, compute it, reply to that message to the named port and make another request.
The programs communicate for some time, and suddenly GetQueuedCompletionStatus returns error 998 (ERROR_NOACCESS). When there is one thread everything seems to be ok. Any idea what could be wrong? What could be the reason of such an error?
Waiting for any idea
Gosia
|
|
|
|
|
what do the first few lines of "winuser.h" look like ?
|
|
|
|
|
me think it's some typo in one of his .h file that gets propagated to other files.
|
|
|
|
|
for example from: http://www.cs.umbc.edu/~squire/download/WinUser.h
/****************************************************************************
* *
* winuser.h -- USER procedure declarations, constant definitions and macros *
* *
* Copyright (c) Microsoft Corporation. All rights reserved. *
* *
****************************************************************************/
#ifndef _WINUSER_
#define _WINUSER_
//
// Define API decoration for direct importing of DLL references.
//
#if !defined(_USER32_)
#define WINUSERAPI DECLSPEC_IMPORT
#else
#define WINUSERAPI
#endif
#ifdef _MAC
#include <macwin32.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifndef WINVER
#define WINVER 0x0500 /* version 5.0 */
#endif /* !WINVER */
#include <stdarg.h>
#ifndef NOUSER
typedef HANDLE HDWP;
typedef VOID MENUTEMPLATEA;
typedef VOID MENUTEMPLATEW;
#ifdef UNICODE
typedef MENUTEMPLATEW MENUTEMPLATE;
#else
typedef MENUTEMPLATEA MENUTEMPLATE;
#endif // UNICODE
...
....
.....
|
|
|
|
|
i was interested in seeing your copy of winuser.h , since that's what your compiler is looking at.
but, you should also take a look at your stdafx.h file and everything that it #includes, and make sure there are no obvious syntax errors there
|
|
|
|
|
I use Visual Assist, and the bracket after the line-extern "C" is red, so I may lose the latter bracket.
But I can not find where.
|
|
|
|
|
it is usually at the bottom of the file
|
|
|
|
|
bloodwinner wrote: pop out so many errors, which seemed don't even exist:
--------------------Configuration: 12 - Win32 Debug--------------------
Compiling...
StdAfx.cpp
c:\program files\microsoft visual studio\vc98\include\winuser.h(3) : error C2143: syntax error : missing ';' before '.'
Have you compiled a VC++ 6.0 project with VC++ 8.0?
|
|
|
|
|
no, only VC++6.0.
I just wanted to check winuser.h, maybe edited something unconsciously
|
|
|
|
|
On VC++ 2003...
I get tons of odd errors when I make a copy of a project (build directories and all) and try to compile it in the new location.
I have to do a rebuild (or delete the build directories) and the gazillion errors go away. I haven't a clue if this would help but it's worth a try.
|
|
|
|
|
bloodwinner wrote: pop out so many errors, which seemed don't even exist:
--------------------Configuration: 12 - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Check your stdafx.h for missing semicolon or some other syntax errors.
There is some problem with your include statements. As the errors point towards this.
|
|
|
|
|
pop out so many errors, which seemed don't even exist:
--------------------Configuration: 12 - Win32 Debug--------------------
Compiling...
StdAfx.cpp
c:\program files\microsoft visual studio\vc98\include\winuser.h(3) : error C2143: syntax error : missing ';' before '.'
c:\program files\microsoft visual studio\vc98\include\winuser.h(3) : error C2501: 'winuser' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\winuser.h(3) : error C2143: syntax error : missing ';' before '.'
c:\program files\microsoft visual studio\vc98\include\winuser.h(27) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio\vc98\include\winuser.h(27) : error C2447: missing function header (old-style formal list?)
c:\program files\microsoft visual studio\vc98\include\winuser.h(7127) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(7474) : error C2001: newline in constant
c:\program files\microsoft visual studio\vc98\include\winuser.h(8267) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(8292) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(8300) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(8309) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(8526) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(8529) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(8534) : error C2014: preprocessor command must start as first nonwhite space
c:\program files\microsoft visual studio\vc98\include\winuser.h(9427) : fatal error C1070: mismatched #if/#endif pair in file 'c:\program files\microsoft visual studio\vc98\include\winuser.h'
Error executing cl.exe.
12.exe - 15 error(s), 0 warning(s)
|
|
|
|
|
I see a BIG DIFFERENT in performance, between the following 2 methoods, WHY IS THAT?:
---------------Method 1-----------------------------
Class
{
Member x
Function()
{
Write to x;
}
}
Main()
{
Call function()
}
--------------Method 2:--------------------------------
Class
{
Function(member x)
{
Write to the member x;
}
}
Main()
{
Member x ;
Call function (x)
}
|
|
|
|
|
Haoman17 wrote: I see a BIG DIFFERENT in performance, between the following 2 methoods,
if the second method is faster, it could be because the constructor or destructor of 'Member' takes a long time.
if the first method is faster, it could be because you're doing a deep copy of 'x' when passing it.
|
|
|
|
|
Could you post the code you used in the testing?
Best,
Jun
|
|
|
|
|
They will execute at the same speed if you pass x by reference in Method 2. Otherwise, if Member is a complex datatype, Method 2 will run slower since it has to copy the value of x into the function before entering the function.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hello,
I have create a CComboBox with like that and when I click on the droplist it happend nothing but when I use push left or right key the value chang.
CComboBox * pcombo=NULL;
pcombo = new CComboBox;
pcombo->Create(WS_CHILD|WS_VISIBLE|CBS_DROPDOWNLIST, CRect(x,y,rect.Width(),20), this, i);
How can I create or witch propertie should I use to do what I want to do.
Thank You
AutreChien
|
|
|
|
|
Do you need to create it at runtime? Does changing the (height) value of 20 to something larger make any difference?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|