|
hi,
i want to create a outlook like application in that i want to create two views left is tree view and right is the list view but the problem is-------
i want a caption bar with a close button in the left view that work dynamically and in the right view i just want to create a list view with caption only no button.
please give me any idea about it how we can do this.
|
|
|
|
|
First, copy this function:
<br />
void ModifyStyle(HWND hwnd, DWORD dwRemove, DWORD dwAdd)<br />
{<br />
DWORD dwStyle = ::GetWindowLong(hwnd, GWL_STYLE);<br />
DWORD dwNewStyle = (dwStyle & ~dwRemove) | dwAdd;<br />
<br />
::SetWindowLong(hwnd, GWL_STYLE, dwNewStyle);<br />
}<br />
Call it like this: ModifyStyle(window_handle, WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX, 0);
This will remove all the buttons in the caption bar.
However, I don't know how to make just the close button appear without making it a tool window.
-Greg Dolley
|
|
|
|
|
hi
In our project we create the chat window ,in this we place emotions with tooltips.Here the problem is the tool tips are not appered in chat window ie message window . so please kindly any body help us in our project.
#sanroop#
|
|
|
|
|
#define MACRO_FUN(b) { if(b) return; printf("2");}
inline void Inline_Fun(bool b)
{
if(b)
return;
printf("2");
}
void Calling_Fun()
{
//Inline_Fun(true);
MACRO_FUN(true);
printf("1");
}
int main(int argc, char* argv[])
{
printf("\n\t");
Calling_Fun();
printf("0");
printf("\n\t");
return 0;
}
When I call 'Inline_Fun(true);' o/p is 10 ..... while When I call 'MACRO_FUN(true);' o/p is 0. Why like this? ( I am using VC6)
I want to return from 'Calling_Fun()', when control reached to 'return' statement of 'Inline_Fun(bool b)' < same as in 'MACRO_FUN(b) >
Thanks & Best Regards,
Aniket Salunkhe
|
|
|
|
|
what is o/p ? You have a serious flaw in your macro. When you define a macro, the preprocessor replaces the code where ever you used the macro. So when using MACRO_FUN , at compile time the code would look like
void Calling_Fun()<br />
{<br />
if(true) <br />
return; <br />
printf("2");<br />
printf("1");<br />
}
But you inline function, will not do the same. The return statement will exit the function and return to the Calling_fun() function then print your statements.
|
|
|
|
|
a macro is a text replacer.
given
void Calling_Fun()
{
MACRO_FUN(true);
printf("1");
}
the preproccessor gives to the compiler the following:
void Calling_Fun()
{
{ if(true) return; printf("2");}
printf("1");
}
A inline function is -instead- an ordinary function that is compiled in the including unit. No preprocessing is involved, so the return in your inline_Fun returns from the function.
There is no way to do what you ask in the way you expect because the language semantics is not as you intend.
a workaround can be the use of exceptions, but if you are in trouble in distinguishing a macro semantics from a function semantics, that's not the way to go.
____
posting suggestion:
use <pre> you code </pre> to preserve code formatting.
-- modified at 8:20 Monday 4th September, 2006
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Hi, I use the following code to get the name of the current desktop, but the buffer is not filled.
char s[MAX_PATH];
DWORD l;
...
GetUserObjectInformation(GetThreadDesktop((DWORD) GetCurrentThreadId), UOI_NAME, s,l);
...
Why this happens?
Is there any other methods to get the name of the current desktop?
|
|
|
|
|
Your last parameter to GetUserObjectInformation() is wrong. It needs to be the length of the buffer in the third parameter ("s" in your case). In your example, the value should be MAX_PATH.
-Greg Dolley
|
|
|
|
|
Hi,
In a current project we have massive problems of locating memory leaks, so I was ordered to write a class using the PDH performance log functions that allows to take performance shots (used handles, allocated memory etc.) at specific points. On this way we want to locate which actions of the program are the big memory eaters and where we have to concentrate on, or if the whole problem is a memory leak at all or maybe simply a fragmentation problem.
As I'm new to PDH I wanted to ask, which counters I should use to get the allocated memory of a specific process. I know there is the Page File Bytes counter which shows how much of the Page file is used by the system, but is that all I need? Is there maybe a special counter giving the total amount of memory allocated by a process or do I (or my evaluating Excel-sheet) have to sum up several counters?
Is PDH a component of every Windows XP installation no matter how minimal the installation will be, or do I have to deliver the PDH.dll with my other project dll files just to be sure? Or if I enter the pdh.lib in the link file, it should be linked statically and my class doesn't need the pdh.dll any more, correct?
Bye
Martin Dietz
Oh, BTW I'm using Visual Studio 6.0 programming for Windows XP Professional plattforms, just in case that this influences your answer
|
|
|
|
|
Hi all,
I have to work on an application that implements whiteboard feature and allows two people sitting in remote locations to modify and work on a single file.(Say a word document or a text file). Changes made by one person are reflected on to the other's machine.
Any ideas/suggestions?(Link to articles/samples that achieve something of this sort)
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Use a memory mapped file giving it a unique name when opening it. CreateFileMapping() . Just search the articles here for "shared memory" you will find several examples.
|
|
|
|
|
Hi,
I need to detect whether is mouse left button down...
I need somethink as GetMouseButtonDown(...)
Thanks
|
|
|
|
|
|
Well, a few days have passed since he last asked. I suppose it's possible that the whole way Windows handles messages might've changed since then
|
|
|
|
|
You don't understand me!!! I know WM_LBUTTONDOWN, WM_MOUSELEAVE and all mouse messages!!!
But I need to get mouse flags wherever in code... Ouf of CWnd object, simply wherever
|
|
|
|
|
What I was trying to say was that there's nothing there to tell you what the mouse is *currently* doing, just messages that happen when the status changes.
All you need to do is have a boolean member in your class - in your LBUTTONDOWN handler, set it to true, in MOUSELEAVE set it to false
|
|
|
|
|
But I don't do this!!! Because if MOUSELEAVE then left mouse button don't to be UP...
Simply, I want to attest whether mouse left button is UP or Down when mouse is out of window (CWnd object)... You understand me???
|
|
|
|
|
You might need to use the SetCapture function.
Steve
|
|
|
|
|
that's why you ask exactly the same question once again ?
you don't provide more infos... you just did a copy/paste of your previous question. hey, we're not geniuses. come on, help us !
|
|
|
|
|
|
You might want to look up the following:
- WM_LBUTTONDOWN
- GetKeyState
- GetAsyncKeyState
Steve
|
|
|
|
|
Thanks Steve, GetAsyncKeyState() is correct...
Thanks very much
|
|
|
|
|
Hello,
I'm working to define a toolbar. I would like to modify the handle.
I have drawn a picture, put it inside the toolbar as handle but I could manage the picture as a handle. I Used a CStatic and then loaded a Bitmap into it.
Does somebody know how to get the picture ID to after allocate it as handle ?
titi
|
|
|
|
|
hi pals,
i facing problem in enableing the scroll bars in CXListCtrl.
if any one worked on this plz help me out.
I am creating ctrl from another file, and passing listctrl obj to that corresponding page. after adding the data, the scroll bar will be disabled state..
can any one suggest options to enable scroll bar?
Thanx in advance.
Parthiban
|
|
|
|
|
can i alter an extension .jpg or bmp to extension .ico? thank u
Li Zhiyuan
8/06/2006
|
|
|
|