Search found 396 matches

by Josep Roca
Mar 09, 2019 0:16
Forum: General
Topic: (SOLVED) macro _WIN32_WINNT return wrong
Replies: 11
Views: 473

Re: macro _WIN32_WINNT return wrong

Which macro? _WIN32_WINNT is not a macro but a constant. Therefore, it will hold whatever value you assign to it.

If you don't define it, it will have a default value of &h0502.

Code: Select all

#ifndef _WIN32_WINNT
   const _WIN32_WINNT = &h0502
#endif
#ifndef WINVER
   const WINVER = _WIN32_WINNT
#endif
by Josep Roca
Feb 17, 2019 21:44
Forum: Windows
Topic: Dpi awareness functions not included?
Replies: 20
Views: 777

Re: Dpi awareness functions not included?

> I tried the manifest settings from the microsoft sites. It simply didn't work. Try this one: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:sche...
by Josep Roca
Feb 16, 2019 13:04
Forum: Beginners
Topic: Alias
Replies: 3
Views: 189

Re: Alias

Alias is for exported procedures. The alternate name cannot be used within the program to call the procedure.

You can use #define my_func my_func2
by Josep Roca
Feb 15, 2019 13:01
Forum: Beginners
Topic: FileDateTime() for Unicode
Replies: 14
Views: 571

Re: FileDateTime() for Unicode

> WHY???

Because you're using CreateFile instead of CreateFileW.
by Josep Roca
Feb 14, 2019 14:57
Forum: Beginners
Topic: FileDateTime() for Unicode
Replies: 14
Views: 571

Re: FileDateTime() for Unicode

> How to remove the warning from 'close fh'?

Using the correct API function (CloseHandle) instead of Close.
by Josep Roca
Feb 12, 2019 1:53
Forum: Windows
Topic: Dpi awareness functions not included?
Replies: 20
Views: 777

Re: Dpi awareness functions not included?

If your application is not DPI aware, you will always get a DPI of 96, no matter if you are using 125% or another value. Make your application DPI aware by using an appropriate manifest of by calling the SetProcessDPIAware function. Non DPI aware applications are virtualized by Windows when using a ...
by Josep Roca
Feb 11, 2019 12:44
Forum: Beginners
Topic: FileDateTime() for Unicode
Replies: 14
Views: 571

Re: FileDateTime() for Unicode

> (I suppose it's pointless to ask if there is a function to set the file modification date...)

There is a Windows function called SetFileTime:
https://docs.microsoft.com/en-us/window ... etfiletime
by Josep Roca
Feb 11, 2019 12:30
Forum: Beginners
Topic: FileDateTime() for Unicode
Replies: 14
Views: 571

Re: FileDateTime() for Unicode

No, but it is not difficult to write a replacement: ' ======================================================================================== ' * Unicode replacement for Free Basic's FileDateTime. ' Returns the file's last modified date and time as Date Serial. ' wszFileName : Filename to retrieve ...
by Josep Roca
Feb 10, 2019 1:03
Forum: Windows
Topic: Dpi awareness functions not included?
Replies: 20
Views: 777

Re: Dpi awareness functions not included?

To get the DPI, you can use:

Code: Select all

DIM hDC AS HDC = GetDC(HWND_DESKTOP)
DIM dpi AS LONG = GetDeviceCaps(hDC, LOGPIXELSX)
ReleaseDC HWND_DESKTOP, hDC


To get the scaling ratio, just divide dpi by 96.
by Josep Roca
Feb 10, 2019 0:47
Forum: Windows
Topic: Dpi awareness functions not included?
Replies: 20
Views: 777

Re: Dpi awareness functions not included?

> apparently I can't use SetProcessDpiAware on win10. Why not? I use it. > Simply editing the manifest to set the awareness to false (this should be the default state, not the case in winfbe ide examples I found) is useless for some reason, so I need the functions. Why should it be the default state...
by Josep Roca
Feb 08, 2019 20:50
Forum: Windows
Topic: Windows Button Image
Replies: 25
Views: 814

Re: Windows Button Image

Change hImage to hBitmap or change hBitmap to hImage.
by Josep Roca
Feb 08, 2019 18:58
Forum: Windows
Topic: Windows Button Image
Replies: 25
Views: 814

Re: Windows Button Image

Something like this: #define WIN_INCLUDEALL #include once "windows.bi" #include once "win\commctrl.bi" Dim As MSG msg Dim Shared As HWND hWnd, edit ' Create window hWnd = CreateWindowEx( 0, "#32770", "Bitmap Button Test", WS_OVERLAPPEDWINDOW Or WS_VISIBLE , 10...
by Josep Roca
Feb 08, 2019 18:10
Forum: Windows
Topic: Windows Button Image
Replies: 25
Views: 814

Re: Windows Button Image

Create a button with the BS_BITMAP style and then send a BM_SETIMAGE message with the handle of your bitmap.
by Josep Roca
Jan 28, 2019 12:03
Forum: Community Discussion
Topic: How many people actually use FreeBasic?
Replies: 85
Views: 12145

Re: How many people actually use FreeBasic?

> and in fact I don't like to use & to join strings because 2 keys(shift and 7) have to be pressed, I prefer to `+` symbol

And what prevents you to use + instead of &? You can use both with FreeBasic.
by Josep Roca
Jan 21, 2019 6:42
Forum: Beginners
Topic: FileExists() and FileCopy() supporting Unicode file names
Replies: 7
Views: 400

Re: FileExists() and FileCopy() supporting Unicode file names

> Where functions can be found which would support file names like "Сергeй.txt"? Here: https://github.com/JoseRoca/WinFBX From AfxWin.inc: ' ======================================================================================== ' Searches a directory for a file or subdirectory with a nam...

Go to advanced search