|
The definitions you're trying to access are in the #if/#endif block:
#if (_WIN32_WINNT >= 0x0400)
#endif
Add the following line before #include <winuser.h> :
#define _WIN32_WINNT 0x0400
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
first of all let me thank you your help, but I'm a novice and I'm still having some problems:
if I define the _WIN32_WINNT 0x0400 then I get 36 errors that are like:
UNRESOLVED EXTERNAL SYMBOL __imp__SetWindowsHookExA@16
UNRESOLVED EXTERNAL SYMBOL...
If I try to include the winuser.h in the same cpp file then I get errors in the winuser.h ile (I think I must be missing some header file again)
Do you know what's happening?
At last, thank you again.
|
|
|
|
|
To avoid linker errors, add user32.lib to the list of libraries your project uses (Settings/Link/Object & library modules).
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
So... it seems like you want your app and prevent the user from shutting it down while it slowly starts up, right?
If this is what you want, let me suggest a better way. Simply display some sort of splash screen that indicates the progress of the startup. This will make the initial wait more tolerable and give the user feeback as to what's going on.
I just don't think you should take away the user's ability to shut your (or any other) app down. Imagine if it was done to you how you'd feel.
Regards,
Alvaro
|
|
|
|
|
I have loaded a dll in one thread, and then released it from the other thread. I am getting errors some times. is this is possible to load a dll in one thread and then releasing from the other thread. the handle of the dll is on the global scope.
|
|
|
|
|
Standard or mfc extension dll?
|
|
|
|
|
I'm trying to code a little utility to save icon positions but I'm
getting errors with my code. Can anyone see what I'm doing wrong?
Heres the code:
//----------------------------------------------------------------------------------------------------------
void StoreIconPositions()
{
//get screen dimensions
int cX = GetSystemMetrics(SM_CXSCREEN);
int cY = GetSystemMetrics(SM_CYSCREEN);
//convert to a string
string FileName = itos(cX) + itos(cY) + ".txt";
//try and open the file. If fail then we create a new file
ofstream out(FileName.c_str(), ios::trunc);
//get handle to desktop
HWND hwndLV = GetTopWindow(GetTopWindow(FindWindow("ProgMan",
NULL)));
//get number of items
int nMaxIcons = ListView_GetItemCount(hwndLV);
for(int nItem = 0; nItem < nMaxIcons; nItem++)
{
char IconName[MAX_PATH];
POINT pt;
//**************THIS IS WHERE IT CRASHES***********//
// Get the name and position of a listview item.
ListView_GetItemText(hwndLV, nItem, 0, IconName, MAX_PATH);
ListView_GetItemPosition(hwndLV, nItem, &pt);
// Save the name and position
out << IconName << endl << pt.x << endl << pt.y << endl;
}
return;
}
//----------------------------------------------------------------------------------------------------------
Thanks for any help.
fup
|
|
|
|
|
You are passing a pointer to another process (Explorer). The pointer in your app's process space cannot be used in another process, thus the crash.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
So what do I have to do to resolve this problem Mike?
|
|
|
|
|
The way I've seen described is to write an in-process COM server with one object. You also write a separate EXE which calls SHLoadInProc() to have the shell create your COM object. Once that's done, your COM object is running in the shell's process space, and you can then do what you want. The user runs the EXE, and the COM object saves the icon positions.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
I have done an alarm app.... a dialog box apears on alarm but if I have focus on another
window the box is in the background!
how??
I use MFC and don't want win32 code help!!
/*
BETA
*/
|
|
|
|
|
Use SetWindowsPos with HWND_TOPMOST.
Regards.
Carlos Antollini.
|
|
|
|
|
Hello all,
I've to rebuild a 'analyser' to a MDI application on which each doc/view output is generated, and sometimes very fast and a lot.
Each doc/view has it's own socket-connection to external equipment. These equipment produces sometimes a lot of 'debugging' information, which is displayed in the doc/view. The communication is via UDP/IP and a fixed protocol using a form of windowing is used.
My problems/questions
---------------------
1. What kind of control is most reliable for fast writing and deleting lines for displaying by the application itself: CEdit or CList (or other control which has past CodeProject). Deleting is required, since we only want to keep x-amount of lines available (preventing memory eating).
2. What is the best way of architecture to implement this, refering on fast
handling and MDI? No user-input is required, only initially to setup the connection. Of course: when a lot of data is being dumped, the controls to buttons for: End Connection, exit application etc has to be remain a bit responsive. That is already a problem in the current application...
Thanks in advance,
EiSl
|
|
|
|
|
> 1. What kind of control is most reliable for fast writing and
> deleting lines for displaying by the application itself: CEdit
> or CList
CListCtrl is much easier to use when you want to insert/delete lines. Also, CEdit has serious capacity limitations on Win9x - don't know how much it affects you.
Are you just putting the information on the screen, or also store it somewhere else in your program for statistics/detailed info etc.? If yes, you can consider using LVS_OWNERDATA style for your list control.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I have a loop that i use to reset checkboxes in a dialogbox.
the setcheck works
the setfont works
but i can not get the settextcolor to work
any input would be appreciated.
for(int i = 0;i < 18;i++){
pButton[i]->SetCheck(false);
pButton[i]->SetFont (&m_checkfont);
pButton[i]->GetDC()->SetTextColor(RGB(255,0,0));
}
|
|
|
|
|
If you want to have captions with specific color, you'll need to use owner-drawn controls. The way you're trying to achieve this effect is totally wrong now - the device context obtained from GetDC isn't used by WM_PAINT handler for checkboxes. Additionally, you have a major GDI resource leak - you're not releasing the context.
Since you apparently have 18 checkboxes, I'd use CListCtrl with LVS_EX_CHECKBOXES extended style. Changing item text color in CListCtrl is easier - CListCtrl::SetTextColor does that.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I'm looking for a tool to convert MSVC RC scripts into HTML, specifically, dialog resources. I have many dialog resources to convert, so I'd rather not do all the work by hand. Any ideas.
|
|
|
|
|
how can i correct this error?
fatal error C1088: Cannot flush compiler intermediate file: 'C:\TEMP\a00202sy': No space left on device
|
|
|
|
|
Isn't the message self-explanatory? Your C: disk is full, try to clean the c:\temp folder.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
...hello,
I have a little problem.
I have a dialog box resource in which i put a Tab Ctrl. Since i need a new Tab Ctrl in the first, under the first, i put another Tab Ctrl.Unfortunetaly this one do not appear at the run-time.
Is anybody has an idea?
Thank for help
R.G
|
|
|
|
|
Hi all,
I tried caching Internet URLs. In that I faced a problem.i.e., After clicking some pages ,Back button helps in getting the Previous pages.But When the Homepage is reloaded , the Back Button should get disabled preventing the Users to go previous pages.
Have any of you come across such problems?? If so , Pls help me Out.
Regards
Maria
maria@sdsindia.com
|
|
|
|
|
I have done gialog based application and now I want to do frame with scrollview, which open when I click a button on my maindialog. I have create a framewindow with its create-funktion and its open but I don't understand how can I set my scrollview within it? I try do it with document template but its need(?) MDI or SDI besed applicatio. Then I try framewindows createview-function but I dont understand how CCreateContext works and its need doctemplate too(?). Actually I want to do some kind of window whitch I can Scroll and I can draw line to it view, a kind of "historydiagram."
I wish you help me,
Tanja
|
|
|
|
|
Hello, I'm writing a client - server application and I have encountered several problems
1) - My server application has to start minimized to tray (no window) and if the user clicks on the tray icon - a popup menu with commands shows - on which you may show the window, etc.
I'm using CSocket to communicate with the server, since it can use archives to transfer(as far as I know you can't do this with CAsyncSocket).
Okay, I can't separate my listen from accept functions - the socket class seem to respond only to OnReceive event. So - it blocks untill it gets connection - after that it's ok. The question here is how to fix that block?
2) - I start my application with SW_HIDE parameter in the CWinApp class - so it has to be invisible, right? But no, after the block, my window shows for a milisecond and hides again. - Any ideas of fixing that?
3) - The UpdateCommandUI on the popup menu (which is not the IDR_MAINFRAME), does not seem to work. Question - why?! (I display it when i receive a notification from the tray icon - WM_RBUTTONDOWN)
4) - It is really strange that my search function for files does not work good also - it works perfect on other apps, but on this one it does not work at all - it eider needs Sleep(250) to work ok - or it stops and locks somehow my sockets.
I will be really thankfull to any WORKING workarounds on theese problems.
Thanks,
Deian
|
|
|
|
|
So - it blocks untill it gets connection - after that it's ok. The question here is how to fix that block? Use a separate thread for your socket communications if you need to respond to UI events while waiting for connections
|
|
|
|
|
Thanks a lot, I will try that.
|
|
|
|