|
Do not have the code with me but this is how I do it:
1) Create a normal dialog box.
2) Use a piture control to make line across the dialog box, where the fold will be.
3) Uncheck visable in the piture controls' properties, unless you want it visable when box is unfolded.
4) When dialog box is initialize get and save the size of the dialog box. Then get the rectangle for the piture control and use it to set the folded size (dlgRect.bottom = pictRect.top). (make you are using screen coordinates)
Use MoveWindow() to set new size.
5) You should have added a button, to the unfolded portion of you dialog, that is used to tell it to unfold (normaly called Advanced). Add a handler for that button so that when it is pressed you can resore the dialog to its' origanal size.
That is about all there is to it.
Trust in the code Luke. Yea right!
|
|
|
|
|
Thanks for the assistance, butI think I wasn't clear enough in my question...
There is some code around CodeProject.com that will dropdown a menu just below a button when the button is clicked (like the "Back" or "Forward" buttons on the Internet Explorer toolbar, or the "Views" button on the Windows Explorer toolbar).
Instead of dropping down a popup menu, I want to drop down a dialog box just under the button. When the user clicks outside the dialog box, it will go away.
Thanks,
Neal Stublen
http://www.awesoftware.com
|
|
|
|
|
Expect an e-mail from me later to night, if you have not received it by tomorrow then send me a reminder via e-mail(subject: drop down dialog). I have just what you are looking for at the home. It requires a CDialog derived class to catch the mouse and help position the dialog, and TrackMenue() to pop it up.
I was thinking of writing a aticale on this now I have a reason too.
Trust in the code Luke. Yea right!
|
|
|
|
|
This link may be of help:
http://www.codeproject.com/useritems/RGBA_Colour_Control.asp[^]
It drops a dialog box off of a static control, but the concept is the same.
Chris Richardson
You can stash and you can seize
In dreams begin, responsibilities U2 - Acrobat[^]
Stop being PC and accounting for everyone and his momma's timeframe. Just enjoy your - Rohit Sinha in the content-challenged thread
|
|
|
|
|
Hiya, ok I know about Threads and Processes to a point. A process is the app you run and a thread links 2 apps together. ( I think this is right!! - please feel free to correct me on this!! )
Anyway, how do I run 2 of the same apps ( on separate computers ) and if something is done on one, detect the change on the second app, and update that app to reflect that change??
Thanks,
grahamoj.
|
|
|
|
|
One solution is COM. Another solution is socket.
Kuphryn
|
|
|
|
|
grahamoj wrote:
Hiya, ok I know about Threads and Processes to a point. A process is the app you run and a thread links 2 apps together.
???????
ok i agree with what you says with the process...
but not in the matter of thread, threads are the childs of procesess..i never think it can synchronise or communicate with the independent procesess...
i think ur neeed is the simple synchronisation of two program datas/something else...u just need to perform some sockets/shared memory/pipes/mailslot for acheving that
be specific with you requirements
thanks
CodeTheDreams();
|
|
|
|
|
I have a formview based project, it washes the system, while its clearing, a progress dialog bar appears, but it goes too fast.
Is there any way to slow down the progress dialog bar?
|
|
|
|
|
Anonymous wrote:
Is there any way to slow down the progress dialog bar?
?
Slow down the progress. Add a sleep in your loop...
Just Kidding..
John
|
|
|
|
|
Actually, I'm not sure why you would want to do this. If the operation is too fast for a progress bar to display than you don't need a progress bar. Maybe just use an hour glass.
John
|
|
|
|
|
if your operayion is so fast, just avoid the use of progress bar. it usually helpful when we want to show the progress of lenghty / time consuming operations infront of the crazy users..hihih (pardon me ..)
Just Use the controls in appropriate situations...
thanks
CodeTheDreams();
|
|
|
|
|
I write a program,which I can choose a program(exe file) that and I can run it as a SERVICE.I do it like this:
SC_HANDLE schSCManager = OpenSCManager( NULL, NULL, SC_MANAGER_CREATE_SERVICE);
if (schSCManager==0)
{
Errorrrrrrr
}
else
{
SC_HANDLE schService = CreateService
(
schSCManager,
servicename,
"My Service",
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS|SERVICE_INTERACTIVE_PROCESS ,
SERVICE_AUTO_START,
SERVICE_ERROR_NORMAL,
pPath,
NULL,
NULL,
NULL,
NULL,
NULL
);
if (schService==0)
{
AfxMessageBox("Fail to create");
}
else
{
AfxMessageBox("Service Created");
CloseServiceHandle(schService);
}
CloseServiceHandle(schSCManager);
Now the problem is I choosed one windows application,then whenever it start as service,it stay at STARTING mode,never
go to STARTED mode.Any idea about it?
Thanks.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Once the service object has been added to the SCM database, don't you need a subsequent call to StartService()?
|
|
|
|
|
No,thats not the point.By default it does not start and I have to call StartService(),my problem happendafter calling this function and always stay at STARTING node after calling this function.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I don't see that as a possible state. Perhaps it's one of:
SERVICE_CONTINUE_PENDING
SERVICE_PAUSE_PENDING
SERVICE_PAUSED
SERVICE_RUNNING
SERVICE_START_PENDING
SERVICE_STOP_PENDING
SERVICE_STOPPED
What does StartService() return?
|
|
|
|
|
DavidCrow wrote:
What does StartService() return?
0
DavidCrow wrote:
SERVICE_START_PENDING
I think it stay at this status.It show the service in Services list,and show it whit STARTING state.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
check ur service doesnt depend on another service that hasnt started yet
this happened to me and i had to rummage around and figure out how to make it dependent on other services cos the load order isnt determined
im gonna make an article on this subject when i get a bit of time soon i hope
"penguins have no bill" biz stuff about me
|
|
|
|
|
Thanks for your reply. But I don't think thats the problem,because its windows application and I can run it without problem.It happend when I run it as service.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Since StartService() is returning 0, what does GetLastError() return?
|
|
|
|
|
Thanks for your help David.My problem is solved.I was going the wrong way.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Please enlighten us so that others may benefit.
|
|
|
|
|
|
Clickety!
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
When I resize column by click and drag column header, so that... client area of ListView control look like need to redraw immediately (paint disorderly), but I dont know how to instruct it to do this
help me
I create ListView control and add item to ListView by following code:
<br />
HWND CreateListView (HWND hWndParent)<br />
{<br />
hWndList = CreateWindowEx( 0L,<br />
WC_LISTVIEW,
STR_NULL,
WS_CHILD | WS_BORDER | WS_EX_CLIENTEDGE<br />
| LVS_REPORT | LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_AUTOARRANGE ,<br />
0+10,110, 572,180,<br />
hWndParent,<br />
(HMENU) IDC_TIME_LVW_CONTENT,<br />
hInst,<br />
NULL );<br />
<br />
lvC.iSubItem=0;<br />
strcpy(szText,LVW_TIME_ALERT);<br />
ListView_InsertColumn(hWndList,0,&lvC);<br />
lvC.iSubItem=1;<br />
strcpy(szText,LVW_TIME_RUN);<br />
ListView_InsertColumn(hWndList,1,&lvC);<br />
lvC.iSubItem=2;<br />
strcpy(szText,LVW_TIME_PATH);<br />
ListView_InsertColumn(hWndList,2,&lvC);<br />
lvC.iSubItem=3;<br />
strcpy(szText,LVW_TIME_MESSAGE);<br />
ListView_InsertColumn(hWndList,3,&lvC);<br />
<br />
return hWndList;<br />
}<br />
<br />
<br />
<br />
InsertItemToListView(LPSTR lpszTime, LPSTR lpszRun, LPSTR lpszPath, LPSTR lpszMessage)<br />
{<br />
<br />
INT nCount=SendMessage(hWndLvwContent_Time,LVM_GETITEMCOUNT,0,0);<br />
LVITEM lvI;<br />
<br />
lvI.mask = LVIF_TEXT;<br />
lvI.iItem = nCount;<br />
lvI.iSubItem = 0;<br />
lvI.pszText = lpszTime;<br />
lvI.cchTextMax = sizeof(lpszTime);<br />
ListView_SetItemState(hWndLvwContent_Time,<br />
ListView_InsertItem(hWndLvwContent_Time,&lvI),<br />
LVIS_SELECTED,LVIS_SELECTED);<br />
<br />
ListView_SetItemText(hWndLvwContent_Time,nCount,1,lpszRun);<br />
ListView_SetItemText(hWndLvwContent_Time,nCount,2,lpszPath);<br />
ListView_SetItemText(hWndLvwContent_Time,nCount,3,lpszMessage);<br />
return TRUE;<br />
}
|
|
|
|
|
_skidrow_vn_ wrote:
lvI.cchTextMax = sizeof(lpszTime);
This is not going to return the expected result. lpszTime is a pointer, thus 4 will be returned rather than the actual size of the buffer it points to.
_skidrow_vn_ wrote:
ListView_SetItemState(hWndLvwContent_Time,
ListView_InsertItem(hWndLvwContent_Time,&lvI),
LVIS_SELECTED,LVIS_SELECTED);
Why are you not checking the return value of ListView_InsertItem()? This can have undesirable results when subsequently calling ListView_SetItemText(). Do this instead:
item = ListView_InsertItem(hWndLvwContent_Time,&lvI)<br />
if (-1 != item)<br />
{<br />
ListView_SetItemState(hWndLvwContent_Time, item, LVIS_SELECTED,LVIS_SELECTED);<br />
<br />
ListView_SetItemText(hWndLvwContent_Time,item,1,lpszRun);<br />
ListView_SetItemText(hWndLvwContent_Time,item,2,lpszPath);<br />
ListView_SetItemText(hWndLvwContent_Time,item,3,lpszMessage);<br />
}
According to the documentation, the LVS_AUTOARRANGE style only applies to the LVS_ICON and LVS_SMALLICON styles. It might just be ignored if not needed but why litter your code with unnecessary stuff?
|
|
|
|
|