Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Ankündigungen
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Status bar in QuickWin

ltabarov
Einsteiger
3.584Aufrufe
Dear everybody:

Is it possible to change the number and the size of parts in the status bar of the main QuickWin window? I have Compaq Visual Fortran 6.6A.
0 Kudos
28 Antworten
Jugoslav_Dujic
Geschätzter Beitragender II
2.406Aufrufe
Yes, but that's not so easy. First, QuickWin status bar is not standard Windows status bar, but a "home-brew" control containing two static controls. What I do is to destroy it in PROGRAM first:
hFrame=GETHWNDQQ(QWIN$FRAMEWINDOW)
hMDI=FindWindowEx(hFrame,NULL,LOC('MDIClient'C),NULL)
hStatus=GetWindow(hMDI,GW_HWNDNEXT)
iSt=DestroyWindow(hStatus)

...and then create my own standard status bar. However, the gotcha is that it cannot be created from PROGRAM, but from QuickWin's primary thread. Main window must be subclassed for that. QWToolbar sample on my home page illustrates the technique with a toolbar. Your code will be similar -- use CreateStatusWindow instead of CreateToolbarEx. After, use SB_SETTEXT messages to set the text of toolbar fields.

iSt=SendMessage(hFrame,WM_CREATESTATUS,0,0)
!In FrameWindowProc:
CASE (WM_CREATESTATUS)
   hStatus=CreateStatusWindow(WS_CHILD,''C,hFrame,0)
   iSBFieldPos(5)=jWidth-20
   iSBFieldPos(4)=jWidth-100
   iSBFieldPos(3)=jWidth-180
   iSBFieldPos(2)=jWidth-260
   iSBFieldPos(1)=160
   iSt=SendMessage(hStatus,SB_SETPARTS,5,LOC(iSBFieldPos))
   iSt=ShowWindow(hStatus,SW_SHOW)
   FrameWindowProc=0


HTH
Jugoslav

ltabarov
Einsteiger
2.406Aufrufe
Thanks a lot. I will try and let you know.

Best regards,

ltabarov
ltabarov
Einsteiger
2.406Aufrufe
Dear Jugoslav:

I tried your suggestion. First, I decided to remove the status bar from the frame window. I inserted the suggested four line code into a simple exemplary program. The result was as follows:

C Remove status bar
! This line works
hFrame=GETHWNDQQ(QWIN$FRAMEWINDOW)
! This line works
hMDI=FindWindowEx(hFrame,NULL,LOC('MDIClient'C),NULL)
! This line works
hStatus=GetWindow(hMDI,GW_HWNDNEXT)
!!!!!!!!!!! This line DOES NOT WORK
iSt=DestroyWindow(hStatus)

What have I done wrong?

The entire project is attached.


Best regards,

ltabarov
Jugoslav_Dujic
Geschätzter Beitragender II
2.406Aufrufe
Hi Lev,
Mea culpa -- I changed that very line when posting. In the
original (rather old) code there was:

iSt=SendMessage(hStatus,WM_CLOSE,0,0)

I was wondering why I didn't use more ellegant DestroyWindow instead... Now I know the answer -- because it didn't work :-).

I also added the status creation code (attached).

Jugoslav

P.S. You can attach files in Intel forum, but that must be the last thing to do (i.e. if you attach first then, say, do a Preview, files won't be attached).
ltabarov
Einsteiger
2.406Aufrufe
Hi, Jugoslav:

Finally, I killed the old status bar. Thanks for helping.

Next, I will try to create a new one. I'll let you know.


Regards,


Lev
ltabarov
Einsteiger
2.406Aufrufe
Jugoslav:

Finally, I tried the code attached to you previous message. It works!

Thanks for your time and generosity.


Best regards,

Lev
marshallc
Einsteiger
2.406Aufrufe
Yugoslav (or anyone reading this),
Would you still have the code handy for making modifications to a status bar in a QuickWin environment? If so, could you send that to me?
Regards,
Chad
Steven_L_Intel1
Mitarbeiter
2.405Aufrufe
Jugoslav is off the net for now. He will probably return in a few months. (I did hear from him last week, though!)
marshallc
Einsteiger
2.406Aufrufe
Steve,
Would you happen to have the code that Jugoslav attached in the earlier posting? I didn't see a link to download the attachment. Of course, it was posted back in 2002 so itmay havebeen removed.
I'm trying to modify the default QuickWin status bar to show additional information (just like what was originally posted in this thread). In Jugoslav's earlier posting, he provided a small code sample that I tried to get working, but I have not had any luck. Unfortunately, I'm not familiar with Win32 API calls so troubleshooting it is difficult when I'm not sure what I'm looking at. The full code that he provided or any code that could help educate me on how to do this would be greatly appreciated.
Regards,
Chad
Steven_L_Intel1
Mitarbeiter
2.406Aufrufe
No, sorry.
marshallc
Einsteiger
2.406Aufrufe
Steve,
Would you have any recommendations on where I can go to learn more about working with Win32 API? Books? Websites? Anything that can help me figure out how to use them in programs. Right now, I'm trying to figure out how to make the small sample code that Jugoslav provided earlier, and I'm lost. My programming knowledge is limited to just basic coding... no DLLs, no utilization of APIs. This is new territory for me, and I could use any help that you or anyone can provide.
Thanks,
Chad
Steven_L_Intel1
Mitarbeiter
2.406Aufrufe
The best suggestion I have is the book "Compaq Visual Fortran: A Guide to Developing Windows Applications" by Norman Lawrence.
durisinm
Anfänger
2.406Aufrufe
Two books you might find useful are Compaq Visual Fortran by Norman Lawrence, ISBN 1555582494, and the fifth edition of Programming Windows by Charles Petzold, ISBN 157231995X.

You can find a lot of information on Microsoft's site at places like http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/anch_win32com.asp.

CVF and IVF also come with a lot of examples of various techniques and programs.

Mike D.
marshallc
Einsteiger
2.406Aufrufe
Steve,
Yep... that's the one that I'm reading... and just realized that your name is acknowledge a couple times in there :)
The only problem is thatthe discussion about Win32applications also starts utilizing SDI and MDIapplications which evidently have a different layout fromQuickWin. I'm trying to follow what is being done, but the Quickwinapplication doesn't seem to have the samelayout as these other applications.
I know that probably sounds like no-brainer... they should be different, but I'm getting lost when he startsdiscussing WinMain and MainWndProc. They don't exist in QuickWin... or at least that's what I thought until I saw the posting from Jugoslav. I thought that usage of theWin32 API calls inthe following chapters (which included modifying status bars) could only be done with SDI and MDI applications.
What would help is to see the status bar being modified in a QuickWin application (or what Visual Fortran provides for a QuickWin application template). I think that is what Jugoslav was trying to provide. The examples in the book demonstrate how to do it in an SDI application. Since I'm not that "comfortable" with Win32 API, I'm not sure how to modify the code to fit into a QuickWin application. Any suggestions?
Regards,
Chad
marshallc
Einsteiger
2.406Aufrufe
Thanks for the info, Mike. I'll see if I can get my hands on a copy of the Programming Windows. I've seen that referenced a couple times with getting more info on Win32 API.
durisinm
Anfänger
2.406Aufrufe
I'm not an authority on QuickWin or Win32 applications, but I know that you can call at least some of the Win32 API routines from QuickWin programs. I once wrote a QuickWin program that was able to display the Win32 dialog for choosing a file to open.

Mike D.
marshallc
Einsteiger
2.406Aufrufe
Yeah, that's what I'm trying to do with calling the status bar in QuickWin. I was able to remove the status bar that comes as a default, but I'm having problems with displaying the new one.
Jugoslav provided a snippet of code from a program he wrote. Unfortunately, I'm not able to figure out what the missing ingredient is. I will either lock-up my window (can't click on any of the menu items and the system beeps at me) or everything comes up just fine but the status bar doesn't show.
Here is what I have in the main program:
hFrame=GETHWNDQQ(QWIN$FRAMEWINDOW)
hInst = GetWindowLong(hFrame, GWL_HINSTANCE)
hMDI = GetWindow(hFrame, GW_CHILD)
lpfnOldFrameProc = SetWindowLong(hFrame, GWL_WNDPROC, loc(FrameWndProc))
iret = SendMessage(hFrame, WM_CREATESTATUS, 0, 0)
Here is what I have in the function FrameWndProc (could have been called MainWndProc I guess):
select case(mesg)
case (WM_CREATESTATUS)

ihWndstatus = CreateStatusWindow (WS_CHILD, ''C, hFrame, 0)
lpParts(5) = cxWidth - 20
lpParts(4) = cxWidth - 100
lpParts(3) = cxWidth - 180
lpParts(2) = cxWidth - 260
lpParts(1) = 160
iret = SendMessage (ihWndstatus, SB_SETPARTS, 5, LOC(lpParts))
iret = ShowWindow (ihWndstatus, SW_SHOW)
FrameWndProc = 0
end select
I've changed this code back and forth so many times trying to get it to work. There is code written in the book that I have, but it is for an SDI application. I'm trying to look at that example and the one that Jugoslav provided and somehow make it work. So far, my attempts have failed.
If anyone could help, I would greatly appreciate the assistance.
Regards,
Chad
anthonyrichards
Neuer Beitragender III
2.406Aufrufe
I can suggest one thing. Since you have subclassed the frame window and you are processing the window messages in FrameWndProc, you probably need to pass on all messages that you do not process to the original window procedure, which is pointed to in the variable lpfnOldFrameProc.
So you needto add
CASE DEFAULT
FrameWindProc=CallWindowProc( lpfnOldFrameProc, hframe, msg, lparam, wparam)
END SELECT
Hope this helps.
marshallc
Einsteiger
2.406Aufrufe
Mike,
Do you still have notes or the code that shows how you called a Win32 dialog box from a QuickWin application? This could help me get an idea on what needs to be setup or done to call the statusbar in my application.
Chad
Steven_L_Intel1
Mitarbeiter
2.281Aufrufe
It's the same as from any other kind of application, really. You can use the IFLOGM module or direct Win32 API calls.
Antworten