NO

Recent Posts

Pages: 1 ... 7 8 [9] 10
81
User contributions / Re: Enable Dark Mode for Title bar
« Last post by John Z on February 05, 2024, 10:58:06 PM »
Hi WiiLF23,

I located a possible solution:
"Replace a Window's Internal Scrollbar with a customdraw scrollbar Control"
over on CodeProject :
https://www.codeproject.com/Articles/14724/Replace-a-Window-s-Internal-Scrollbar-with-a-custo

Sounds reasonable -

I've not tried it yet.

John Z
82
User contributions / Re: Enable Dark Mode for Title bar
« Last post by WiiLF23 on February 05, 2024, 10:46:28 PM »
Hey John Z. It would appear to me that MS may of removed the API exposure for modifying the scrolling bar in order to divert the choices toward the unofficial dark mode visual theme string "Darkmode_Explorer".

I bet you can do this in .NET 7 on Windows 10 easily. I'll never touch Windows 11, or their VS stack again.

That is good info too, that would take a bit of time to discover - thank you for that bit.
83
User contributions / Re: Enable Dark Mode for Title bar
« Last post by John Z on February 05, 2024, 10:27:13 PM »
Hi WiiLF23,

Well sad to say that another feature removed by Micro$oft in WIN10 and onward was the ability to set the scroll bar color!  It was global anyway so it would need to be set back when program looses focus, however SetSysColors for
Code: [Select]
COLOR_SCROLLBAR 0

Scroll bar gray area.

Windows 10 or greater: This value is not supported.

There are web hints that it can be changed through the registry but that seems excessive for an application.  For my program the bars are gray, as most are, so not too visually disruptive in Dark Mode.

I can envision a totally custom drawn scrollbar using bitmap picture controls and line drawings and buttons but every element is reinvented and discrete, possible, but worth the effort?  Maybe it is out there somewhere...

John Z 
84
User contributions / Re: Enable Dark Mode for Title bar
« Last post by WiiLF23 on February 05, 2024, 04:53:22 AM »
Hey John Z, that IBeam cursor looks great (and much easier on the eyes in contrast). Did you sort out the scroll bar color? I'm curious about that, as that is probably the one thing I have not tackled yet for my UI. Dark mode is on hold for the moment, as I work the other controls (basically finished as of today). I cant wait to dive back into it  ;D
85
User contributions / Re: Enable Dark Mode for Title bar
« Last post by John Z on February 05, 2024, 01:51:31 AM »
Hi WiiLF23,

Well yes there are white and dark cursors, but I did not find a white IBEAM....so I just made my own, res1.cur below. It works very well and tied to the editable areas whereas the non-editable areas use the standard arrow cursor.

I misspoke in the prior post when I called out a 'white cursor bar' I was referring to a white caret bar needed as in the picture below, which shows a dark caret. :(

John Z
86
User contributions / Re: Enable Dark Mode for Title bar
« Last post by WiiLF23 on February 04, 2024, 11:09:35 PM »
Hey John Z, the Windows stock cursors have black cursors available in system.

You might just need to align with a custom cursor file:

Code: [Select]
// Load a custom black arrow cursor from resources
HCURSOR hCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_BLACK_ARROW));
SetCursor(hCursor);

I havent come across cursor work yet, but I do switch them back and forth when cursor is over specific REC coordinates (custom close button, etc). I'll post what I find as well.
87
Assembly discussions / Re: printf implementation
« Last post by TimoVJL on February 04, 2024, 11:40:48 AM »
Thanks.
poasm programmers needs an easy way to test code and printf family is useful for them.
88
Assembly discussions / Re: Calling a C++ function from Poasm
« Last post by TimoVJL on February 04, 2024, 11:32:35 AM »
We are here to test Pelle's C tools, so sometimes we offer test with pure C too, when an example is for poasm.

89
Assembly discussions / printf implementation
« Last post by Vortex on February 04, 2024, 11:32:25 AM »
Here is a printf implementation similar to the inlined version of the latest MS VC releases :

Code: [Select]
.386
.model flat,stdcall
option casemap:none

ExitProcess PROTO :DWORD
__p__iob PROTO C
vfprintf PROTO C :DWORD,:DWORD,:VARARG
printf   PROTO C :DWORD,:VARARG

includelib  kernel32.lib
includelib  msvcrt.lib

_iobuf STRUCT

    _ptr        DWORD ?
    _cnt        DWORD ?
    _base       DWORD ?
    _flag       DWORD ?
    _file       DWORD ?
    _charbuf    DWORD ?
    _bufsiz     DWORD ?
    _tmpfname   DWORD ?

_iobuf ENDS

FILE TYPEDEF _iobuf

.data

pi      real8 3.141592
format  db '%s is nearly equal to %f',0
str1    db 'Pi',0

.code

start:

    invoke  printf,ADDR format,ADDR str1,pi
           
    invoke  ExitProcess,0

printf PROC C _format:DWORD,args:VARARG

    invoke  __p__iob

;   #define stdout (&__iob_func()[1])

    add     eax,SIZEOF(FILE)

    lea     ecx,args
    invoke  vfprintf,eax,_format,ecx
    ret

printf ENDP

END start

The Universal C run-time version :

Code: [Select]
int __cdecl __stdio_common_vfprintf(unsigned __int64 _Options, FILE* _Stream, char const* _Format , int _Locale, va_list);

int printf(const char * format, ...)
{
int retVal;
va_list vl;
va_start(vl, format);
retVal = __stdio_common_vfprintf(0, _stdout,format, 0, vl);
va_end(vl);
return retVal;
}


90
User contributions / Re: Enable Dark Mode for Title bar
« Last post by John Z on February 04, 2024, 08:10:41 AM »
Thanks WiiLF23!

I've got a fairly decent Dark Mode toggle.
Since I had previously coded for 5 custom user defined
themes it was not a big leap to add a Dark Mode.
I looked at a Menu in dark mode, easy to do, but decided
not.  So I left the main dialog frame, menu, toolbar and
status bar as is.

I completed a white IBEAM which works well in DarkMode.
Started on the white cursor bar but was having problems, it
showed on the main form but not in the edit boxes. Probably
wrong handle or something. Still looking :)

Thanks very much,
John Z
Pages: 1 ... 7 8 [9] 10