|
Compiler doesn't looks for your files... that is not a compiler error !!!. is not a sintaxis error... because is a string... You know what I mean ??
|
|
|
|
|
I have to get back the static text on a dialog programatically. Say version number on help about dialog which will keep on changing .
But when the code like getwindow text executes the dialog is not active . So grtting invalid handle .please advise
Suman ray
|
|
|
|
|
assuming you have an object in your main program for this dialog and you are also using MFC, then you can assign a variable (CString probably) to the text box using the class wizard and then you should be able to access it in your main program (you may need to add a Get method).
hth
|
|
|
|
|
the problem is that there is no gurantee that this object will be created in program lifetime. In fact if the user does not click on help->about , object is never created.
Suman ray
|
|
|
|
|
Couldn't you create the object in your constructor and then override the help->about method so that it just does "m_HelpDialog.DoModal ( ) ;" ?
This way the object will always exist during the program run.
Andy,
|
|
|
|
|
raysuman wrote:
the problem is that there is no gurantee that this object will be created in program lifetime
perhaps calling IsWindow(..) with the handle of the static control to receive the text from before doing so helps
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
|
|
|
|
|
Does anybody know how windows determines the background colour to use for static and group box controls?
At the moment I have a window (not a dialog) that contains a tab control which contains group, static and edit controls. This works fine if themes are not being used. If I enable themes the background colour for the static and group box controls is different to the colour of the tab control. It would appear windows is using the background colour from the parent window instead of the tab control. I'm wondering if windows uses different rules when the parent is a dialog?
Can anybody offer any suggestions?
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
Control colour's are set via WM_CTLCOLORXXX messages and the returned brush is used to paint the controls background, and the DC passed is used to paint the "foreground".
Theme's are probably getting in the way, and I'm not sure how they fit in the grand scheme of things - I guess you just have a app with a custom manifest file and it looks ok with themes off but not on.
I do remember seeing many apps - MS ones included - that have problems with Tab controls in XP.
This artical may be of use:
http://www.codeproject.com/wtl/ThemedDialog.asp
|
|
|
|
|
Hi All,
Can someone tell me how to identify the font used by Windows Explorer when showing file names? Is it somewhere in the registry?
Thanks,
Chris
|
|
|
|
|
I belive it lives at:
HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics\IconFont
Though if I remeber correctly it's a pain as it's stored as a REG_BINARY along with some extra info.
See
http://perso.wanadoo.fr/tmcd2/Shell.htm#IconFont
|
|
|
|
|
Hi Diddy,
Its ok I found the following... Thanks anyway..
Chris
SystemParametersInfo(SPI_GETICONTITLELOGFONT, uifnt, &fnt, 0);
|
|
|
|
|
Hi,
I am trying to get the error description for the error 12045 using the following code, but it doesnt work and gives me error 317. Any ideas how to get this working?
if (!FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
error_code,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
pMsgBuf,
4*1024,
NULL ))
Thanks,
Sigma
|
|
|
|
|
Well I am using the following code. This checks for error messages of networks too
<br />
LPVOID lpMsgBuf;
<br />
DWORD dwRet = ::FormatMessage( <br />
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER,<br />
NULL, <br />
iErrCode,<br />
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),<br />
(LPTSTR) &lpMsgBuf,<br />
0,<br />
NULL);<br />
<br />
if (dwRet == 0)
{
HMODULE hDll = ::LoadLibraryEx( TEXT("netmsg.dll"), NULL, <br />
DONT_RESOLVE_DLL_REFERENCES );<br />
{<br />
if (hDll != NULL)<br />
{<br />
dwRet = FormatMessage(<br />
FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_FROM_SYSTEM,<br />
hDll,<br />
iErrCode,<br />
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),<br />
(LPTSTR) &lpMsgBuf,<br />
0,<br />
NULL);<br />
::FreeLibrary(hDll);<br />
}<br />
}<br />
}<br />
<br />
if ( m_pszErrMessage!=NULL )<br />
{<br />
delete []m_pszErrMessage;<br />
m_pszErrMessage = NULL;<br />
}<br />
<br />
if (lpMsgBuf != NULL)<br />
{<br />
m_pszErrMessage = new TCHAR[dwRet+1];<br />
::strcpy( m_pszErrMessage, (TCHAR*)lpMsgBuf );<br />
m_pszErrMessage[dwRet-2 ] = 0;<br />
::LocalFree( lpMsgBuf );<br />
}<br />
else<br />
{<br />
m_pszErrMessage = new TCHAR[<br />
strlen("Unknown error in evaluating Error Code")+1];<br />
<br />
::strcpy(m_pszErrMessage, "Unknown error in evaluating Error Code");<br />
}<br />
|
|
|
|
|
The error code 12045 may not belong to system message-table. You have to know where error occur and look up error from that module.
Here is the code except from MSDN. Hope useful to you
<br />
HMODULE hModule = NULL;
LPSTR MessageBuffer;<br />
DWORD dwBufferLength;<br />
<br />
DWORD dwFormatFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER |<br />
FORMAT_MESSAGE_IGNORE_INSERTS |<br />
FORMAT_MESSAGE_FROM_SYSTEM ;<br />
<br />
<br />
if(dwLastError >= NERR_BASE && dwLastError <= MAX_NERR){<br />
hModule = LoadLibraryEx(TEXT("netmsg.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE);<br />
<br />
if(hModule != NULL)<br />
dwFormatFlags |= FORMAT_MESSAGE_FROM_HMODULE;<br />
}<br />
<br />
<br />
if(dwBufferLength = FormatMessageA(<br />
dwFormatFlags,<br />
hModule,
dwLastError,<br />
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR) &MessageBuffer,<br />
0,<br />
NULL<br />
))<br />
{<br />
DWORD dwBytesWritten;<br />
<br />
WriteFile(<br />
GetStdHandle(STD_ERROR_HANDLE),<br />
MessageBuffer,<br />
dwBufferLength,<br />
&dwBytesWritten,<br />
NULL<br />
);<br />
<br />
LocalFree(MessageBuffer);<br />
}<br />
<br />
if(hModule != NULL)<br />
FreeLibrary(hModule);<br />
|
|
|
|
|
Is netmsg.dll commonly available on all windows versions? (98, nt, 2k, xp)
|
|
|
|
|
netmsg.dll is a Network Management module. It is an example only. In your case, error message can find in another module, depend on the context.
|
|
|
|
|
Yes, 12045 doesnt fall between NERR_BASE(2100) and MAX_NERR(2999).
So any idea which module (dll) should I load for 12045?
Thanks
|
|
|
|
|
Can anyone tell me under what conditions will CreateProcessWithLogonW return "Access is Denied" error. It is running on some computers and giving the error on some computers.
Thanks in advance.
|
|
|
|
|
At a guess, I'd say that the user you're trying to log on doesn't have file-system permission to execute the file you've specified. Check this.
The documentation indicates, for XP and 2003: "CreateProcessWithLogonW accesses the specified directory and executable image in the security context of the target user" and goes on to talk about network drives.
You should also check that the RunAs service is started, on Windows 2000. On Windows XP and 2003, the service is called Secondary Logon.
Also, the documentation states: "The user account must have the Log On Locally permission on the local computer. This permission is granted to all users on workstations and servers, but only to administrators on domain controllers."
A bit of Googling has also revealed that you might need to set the lpDesktop member of lpStartupInfo to Winsta0\Desktop.
Is there any pattern to which computers it works/doesn't work on, with respect to OS and Service Pack level?
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi all,
I'm about to start writing an interface to a webcam and have decided to go the DirectShow route, my question is does anyone know of any good tutorial websites which cover this (I've tried searching for some but they all seem to jump into the deepend straight away), or is it going to be a case of going through other peoples code and trying to figure out what thye are doing?
btw I've never done any DirectX programming before.
many TIA,
Andy
|
|
|
|
|
download the directX sdk from microsoft.
in \\Dx8VcSdk\samples\multimedia\directshow\capture\amcap
you fill find an example, of how to capture all videoinputs
there are more good examples in the sdk
|
|
|
|
|
i need to do some research work on cryptography and ultimately write code to protect the commercial programs that i write to to have some sort of license protection. Any help regarding this will be greatly appreciated.
Thanks
|
|
|
|
|
As my opinion, there are no way can protect your software absolutely. Hackers can decompile any software and with the helping from few debugers, they can trace that code and break down the protection.
So, I think you should concentrate in writing your application as perfect as posible. You can use some protection mechanisms such as: hard disk serial number, hard disk manufature serial number, network card MAC, user information...With a hashing algorithm, you will create yourself software serial number which must be matched to run.
Because infact there are no perfect way, articles about that problem are controversial topics. In codeproject, you can find few such article.
|
|
|
|
|
Best and easier way to protect is having an USB or paralel port security key...
They are easy to implement and very secure, expecially if you make your code dynamically dependent on the existence of that key.
Price: affordable for most commercial applications. If the application is to be used for a lot of computers in a domain, there are special keys that validate the application through the network.
Software-based security is allways possible to crack, except in some very special cases.
|
|
|
|
|