|
The idea is to use GetDIBits to convert from any bitmap format to a 32 bpp DIB.
That seems like a very slow way of creating a 32-bpp DIB compared to using CreateDibSection() and just blitting the source to the created bitmap. Just call GetObject to get the bits later on.
|
|
|
|
|
This seem a better solution, thank for the GetObject suggestion I had no idea of another way to proceed.
Unfortunately Microsoft Q195830 states that "Blitting Between DCs for Different Devices Is Unsupported (Q195830)" under XP, so I'm affraid this method is not safe enough.
Read more at http://support.microsoft.com/default.aspx?scid=kb;EN-US;q195830
I think my problem comes from memory management.
Thank for the reply, I spent my whole weekend trying to fix the bug ;(
Yarp
|
|
|
|
|
I'm using some property pages in a program, the property sheet for some reason has a "help" button on it, I tried to remove it by:
sheet.m_psh.dwFlags &= ~PSP_HASHELP;
But it still won't go, how can I get rid of it? Thanks.
BTW, I think by default the help button should not be there, right?
|
|
|
|
|
|
Cool it worked. Thank you.
|
|
|
|
|
I am trying to get a string of a MFC status-bar (original class name msctls_statusbar32) from another application (which means I access it using hwnd manipulations).. MFC obviously subclassed something there because when I do:
char Text2[1024];
int X = SendMessage(StatusBar, SB_GETTEXT, 0, (LPARAM)Text2);
*StatusBar - The MFC status-bar hwnd.*
I get in X the length as I should (25 in my case), but Text2's value is left unchanged =(.
Do you know how can I get another's application MFCs status-bar text??
Vitaly Belman
|
|
|
|
|
Does anyone know how I could use the script control to read/write to a serial comm port. A friend of mine showed me an application that does this. Inside of the script file it has commands like:
sc.read(&H1)
sc.write("42 04 3F")
Of course, I do not have the source code for this since it is not mine. But, it works slick. The readme file for the app says something that downloading the script control may be necessary for your operating system if you are getting errors so I know it uses it.
|
|
|
|
|
I don't know in what forum to ask this, but since my programs are written in VC++, I will try it here.
I've got two straigt forward questions on how to use Terminal Service and what can be done.
1. Can I write an applikation that the user launches on the server that starts a new terminal server client on the users client?
2. Can I switch logged on user while i'm inside a terminal server session?
If you know any really good site for learning TS programming, please let me know!
Not completely new to MsTsc but almost
|
|
|
|
|
Hello,
I've created a toolbar with 3 toolbar images for normal, hot and
disabled states. I load the image and create the toolbar under the Rebar
without using the resource editor. I noticed that when an adjacent band
covers part of a toolbar button the chevron's drop-down menu show up but not
include the toolbar image. Also, the drop down menu is missing in the menu
for buttons that have BTNS_WHOLEDROPDOWN or BTNS_DROPDOWN style. How do I
fix those? Thanks!
Hiu Sing Ngai
|
|
|
|
|
I use _beginthread( runSearch, 0, NULL) ; to start a search process (thread) in an application )(.cpp file).
runSearch is a void private member of a class I defined myself
However for an unknown reason I get the next Compiler error message.
C:\Program Files\Microsoft Visual Studio\MyProjects\DamageEngine0_0\CEngine.cpp(535) : error C2664: '_beginthread' : cannot convert parameter 1 from 'void' to 'void (__cdecl *)(void *)'
What do I do wrong??
I hate this type of syntax error, which cost me a lot of time.
Presumably the answer is simple (as always).
Thanks in advance,
Bert
|
|
|
|
|
A member function cannot be used as a callback unless it's static. See the VC Forum FAQ for an answer.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Try to define your thread function as:
static unsigned WINAPI runSearch(void* pThreadParameter);
That's what I use with _beginthreadex(). Hope it helps!
|
|
|
|
|
Hello,
I'm working on shell extension but I've got a problem. I would like user able to select one or more files and also folders and right click to access my software (Firegraphic XP). However, when user select more then one folder and access the "Explorer, Open or Search...", my software launch instead of the Explorer. And my software looks launch for each folder. If user only select one folder, everything seems fine. Here's the code I wrote, hope someone can give me some idea.
HRESULT CFiregrxpShEx::QueryContextMenu(
HMENU hmenu,
UINT uMenuIndex,
UINT uidFirstCmd,
UINT uidLastCmd,
UINT uFlags)
{
if (uFlags & CMF_DEFAULTONLY)
return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, 0);
if (m_files.IsEmpty())
return E_INVALIDARG;
int nMenu = 0;
// m_files is the files & folders list (can be max), if the first selected
// is a folder then I want to launch Firegraphic XP and open that folder
if (PathIsDirectory(m_files[0]))
{
InsertMenu(hmenu, uMenuIndex, MF_BYPOSITION, uidFirstCmd++, _T("Browse with Firegraphic XP"));
SetMenuItemBitmaps(hmenu, uMenuIndex, MF_BYPOSITION, g_hBmpFiregrxp, NULL);
nMenu++;
}
else
{
// User selected images
}
return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, nMenu);
}
HRESULT CFiregrxpShEx::InvokeCommand(LPCMINVOKECOMMANDINFO pCmdInfo)
{
if (m_files.IsEmpty())
return E_INVALIDARG;
// Get the Firegraphic.exe InstallPath
TCHAR szPath[MAX_PATH];
HKEY hKey;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Firegraphic\\Firegraphic XP"), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
{
DWORD nData = sizeof(szPath);
if (RegQueryValueEx(hKey, _T("InstallPath"), 0, NULL, (LPBYTE)szPath, &nData) == ERROR_SUCCESS)
PathAppend(szPath, _T("FiregraphicXP.exe"));
RegCloseKey(hKey);
}
STARTUPINFO sui = { 0 };
PROCESS_INFORMATION pi = { 0 };
TCHAR szQuotedFileName[MAX_PATH];
if (PathIsDirectory(m_files[0])) // Browse with Firegraphic XP
{
TCHAR szCmdLine[MAX_PATH];
lstrcpy(szQuotedFileName, m_files[0]);
PathQuoteSpaces(szQuotedFileName);
lstrcpy(szCmdLine, _T(" "));
lstrcat(szCmdLine, szQuotedFileName);
if (CreateProcess(szPath, szCmdLine, NULL, NULL, FALSE, CREATE_BREAKAWAY_FROM_JOB, NULL, NULL, &sui, &pi))
{
CloseHandle(pi.hProcess);
return S_OK;
}
}
return E_INVALIDARG;
}
Hiu Sing Ngai
Firegraphic.com
|
|
|
|
|
On XP the shell invokes context menu extensions when you pick something from the lists on the left Explorer pane. At the beginning of InvokeCommand(), you're not checking pCmdInfo->lpVerb, so your code is running regardless of what menu item was picked (even if it wasn't yours). Check that value, and if it isn't 0, return E_INVALIDARG without doing anything. (It will be 0 for your own menu because lpVerb is a 0-based index telling you which of your menu items was picked; in other cases it's a shell ID or a string.)
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thanks Mike, you saved me lots of time.
|
|
|
|
|
Anyone happen to have the source ZIP file for this app? It's been removed from the MSDN site.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I have a ThemeExplorer sample from the Platform SDK on my HD. Is this the one you are after?
Michael
Logic, my dear Zoe, merely enables one to be wrong with authority. - The Doctor
|
|
|
|
|
|
I want to use somthing like varible that need to be same value for the process. But different values for different processes. How can i do that?
I meant it needs to be in DLL ? Here the variable is single only.
VIKS
|
|
|
|
|
Like GetCurrentProcessId?
Btw, within that process it's not a variable, it's a constant.
|
|
|
|
|
No sir,
But I want a variable only not the constants.
VIKS
|
|
|
|
|
I have a dialog resource in my project with on that dialog a static bitmap. Under Windows 98 it shows the bitmap just fine but under Windows 2000 it doesn't show anything...
Does anyone know why this could be?
Thanks
Kuniva
--------------------------------------------
|
|
|
|
|
Before three hours while iam doing the final integration in my VC++ 6 project, the resource file in my app is only 111MB, but now its 165 MB. Complier throws error like REsource file too large.
Need Advice or Help to be needed. Its Urgent. If you know mail me at shivaa_27@yahoo.com.
Thanks
Shivaa.
India.
|
|
|
|
|
Split it up in two files...
|
|
|
|
|
Hello redeemer,
Thanks. But the exe size also increasing. I dont know the hell it is. How to split the rc file in to two.
Shivaa..
|
|
|
|