News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Adventures in programming: Treeviews, directory scanning, recursion

Started by NoCforMe, April 05, 2024, 10:36:19 AM

Previous topic - Next topic

sinsi

Quote from: NoCforMe on April 19, 2024, 07:28:28 PMThe sequence of events I wrote in pseudocode above should give you a good idea of what's happening in the program:
So now you can read my mind?

Quote from: NoCforMe on April 19, 2024, 07:28:28 PMProgress bar and "Waiting:" text appear
What, like magic?

Quote from: NoCforMe on April 19, 2024, 07:28:28 PMThat's pretty much it. What else can I tell you?
:rolleyes: Don't tell me, show me
🍺🍺🍺

TimoVJL

Use OutputDebugString with variables to see, what really happens.
May the source be with you

NoCforMe

Quote from: TimoVJL on April 19, 2024, 10:55:19 PMUse OutputDebugString with variables to see, what really happens.
Oh, I can do better than that with my LogBuddy®© logging accessory. Shows incoming messages to window procs, displays variable values.
Assembly language programming should be fun. That's why I do it.

NoCforMe

I went ahead and plugged my pic viewer into LogBuddy (specifically, the subclassed window proc for the progress bar), and here's what it gave me:
Message: WM_GETDLGCODE hWin: 10484h, wParam: 0h, lParam: 0h
Message: WM_SHOWWINDOW hWin: 10484h, wParam: 1h, lParam: 0h
Message: WM_WINDOWPOSCHANGING hWin: 10484h, new X: 0, new Y: 0
Message: WM_NCPAINT hWin: 10484h, wParam: 1h, lParam: 0h
Message: WM_ERASEBKGND hWin: 10484h, wParam: 29010CBEh, lParam: 0h
Message: WM_WINDOWPOSCHANGED hWin: 10484h, new X: 165, new Y: 9
Message: (Unknown: value = 1034) hWin: 10484h, wParam: 1h, lParam: 64h
Message: WM_PAINT hWin: 10484h, wParam: 0h, lParam: 0h
Message: (Unknown: value = 1034) hWin: 10484h, wParam: 0h, lParam: 0h
Message: WM_SHOWWINDOW hWin: 10484h, wParam: 0h, lParam: 0h
Message: WM_WINDOWPOSCHANGING hWin: 10484h, new X: 0, new Y: 0
Message: WM_WINDOWPOSCHANGED hWin: 10484h, new X: 165, new Y: 9
Message: WM_GETDLGCODE hWin: 10484h, wParam: 0h, lParam: 0h
That was it for one long disk scan during which the progress bar was put up.

I wonder what that "unknown" (to me) message (1034 decimal) is? Welll, according to this page, it could be any of these:
040a        1034        CBEM_HASEDITCHANGED
040a        1034        RB_INSERTBANDW
040a        1034        SB_GETRECT
040a        1034        TB_ISBUTTONCHECKED
040a        1034        TBM_SETSEL
040a        1034        TTM_HITTESTA
040a        1034        WIZ_QUERYNUMPAGES

Seems like I should be getting a lot more messages than these.
Assembly language programming should be fun. That's why I do it.

NoCforMe

Assembly language programming should be fun. That's why I do it.

zedd151

Before WM_PAINT, wParam is 1, lParam 100
After WM_PAINT, wParam 0 and lParam 0...

Hmmm.... it's been a long time that I worked with progress bars...
But that doesn't look right.

The static progress bar, any indicators 'lit up' or just showing the bar and nothing else.
Ventanas diez es el mejor.  :azn:

NoCforMe

The progress bar shows nothing. Completely blank.

For WM_PAINT, neither wParam nor lParam are used. (All the needed info is in the PAINTSTRUCT structure that's filled out by BeginPaint().)
Assembly language programming should be fun. That's why I do it.

zedd151

Quote from: NoCforMe on April 20, 2024, 07:42:57 AMThe progress bar shows nothing. Completely blank.

For WM_PAINT, neither wParam nor lParam are used. (All the needed info is in the PAINTSTRUCT structure that's filled out by BeginPaint().)


quote from stack overflow
QuoteOne final hunch at why your marquee progress bar is not working. Did you include a manifest for common controls v6? The marquee style is only supported in common controls v6 and up.
manifest issue? Just a shot in the dark on my part...
Ventanas diez es el mejor.  :azn:

NoCforMe

I have that manifest, so no.

  <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="FearNoEvil.DialogGen.1.0" type="win32" />
  <description />
- <dependency>
- <dependentAssembly>
  <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" />
  </dependentAssembly>
  </dependency>
  </assembly>

God, I hate XML ...
Assembly language programming should be fun. That's why I do it.

zedd151

Ventanas diez es el mejor.  :azn:

NoCforMe

Thanks. Read that a long time ago, along with pretty much every other article on Stack Overflow and elsewhere. No help.
Assembly language programming should be fun. That's why I do it.

zedd151

It is probably something simple but overlooked.
Have you tried making a test program? A simple window and only the progress bar?

I gotta go walk the dogs, I might make a little test proggy myself when I get back...


Later:
I got shanghai'd into doing something else... I'll look at making a test program later this evening...
Ventanas diez es el mejor.  :azn:


NoCforMe

Your does work indeed. But Jochen, do you have a separate thread running in that program? That seems to be the source of my problems.
Assembly language programming should be fun. That's why I do it.

jj2007

Quote from: NoCforMe on April 20, 2024, 10:33:05 AMdo you have a separate thread running in that program?

No, but a WM_TIMER handler:

  GuiControl Progress, "progressbar", y0+88, h0+29, w700, style PBS_MARQUEE
...
Event Timer
  sub rv(GetTickCount), ticks
  invoke SendMessage, hProgress, PBM_SETPOS, eax, 0
  SetWin$ hTimeMs=fTime$(0, "HH:mm:ss.fff") ; shows milliseconds

Event Message
  .if uMsg_==WM_HSCROLL ; horizontal trackbar sends this message
mov eax, lParam_
.if eax==hTrack
mov ticks, rv(GetTickCount) ; try to sync with progressbar ;-)
shl rv(SendMessage, lParam_, TBM_GETPOS, 0, 0), 9
sub ticks, eax
.endif