Search found 393 matches

by Josep Roca
Feb 15, 2019 13:01
Forum: Beginners
Topic: FileDateTime() for Unicode
Replies: 14
Views: 317

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: 317

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: 8
Views: 240

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: 317

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: 317

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: 8
Views: 240

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: 8
Views: 240

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: 469

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: 469

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: 469

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: 11104

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: 286

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...
by Josep Roca
Jan 20, 2019 9:28
Forum: Beginners
Topic: Getting the true unicode code
Replies: 21
Views: 1459

Re: Getting the true unicode code

Save the file as utf-16 and you will get a correct code.

If you're going to use unicode string literals you need an editor that works with utf-16.
by Josep Roca
Jan 18, 2019 17:31
Forum: Beginners
Topic: A new Unicode & Newbie problem
Replies: 16
Views: 417

Re: A new Unicode & Newbie problem

Dim As Wstring * 500 namx = "Сергeй"
DIM s AS STRING = SPACE(12)
memcpy STRPTR(s), STRPTR(namx), 12
by Josep Roca
Jan 18, 2019 11:38
Forum: Beginners
Topic: A new Unicode & Newbie problem
Replies: 16
Views: 417

Re: A new Unicode & Newbie problem

> Exactly. I actually thought that I had expressed exactly this as my problem and my question.

But you forgot to say that you were working with a binary file. Everything you said, including the .txt extension of the file, indicated that you were working with a text file.

Go to advanced search