PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 10
 1 
 on: March 21, 2019, 12:47:30 PM 
Started by Eddy Van Esch - Last post by Peter House
Paul,

Nice.  I downloaded (1.9.0x64), installed and wrote my first freebasic program this morning in about 15 minutes.  I used Powerbasic, Roca, and Firefly (purchased) for several years and have been looking for a replacement.

Questions:
1. Is there a way to switch between code and design using the keyboard?
2. I will be using FB to work with a MQTT server and will be creating a header file to allow the use of the available client library.  I am looking for any pointers or help on how to get started.

Thanks again,

Peter House


 2 
 on: March 16, 2019, 11:53:46 AM 
Started by Josť Roca - Last post by Josť Roca
Another nail in the coffin. French tacos, "a hymn to junk food".

See: https://www.theguardian.com/world/2019/mar/15/move-over-mcdonalds-french-taco-poised-for-global-expansion

 3 
 on: March 15, 2019, 06:07:02 PM 
Started by Richard Marchessault - Last post by Wilko Verweij
You are right, of course. I overlooked the difference between hPrevInstance and FF_PrevInstance. Sorry for the confusion.

 4 
 on: March 15, 2019, 06:03:46 PM 
Started by Richard Marchessault - Last post by Josť Roca
I suggest that you reread the post. It is not checking the hPrevInstance parameter, but calling the FF_PrevInstance function, that in turn calls FindWindow.

 5 
 on: March 15, 2019, 05:23:04 PM 
Started by Richard Marchessault - Last post by Wilko Verweij
Hi, I doubt if this actually works. See : https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-winmain
Quote
Type: HINSTANCE

A handle to the previous instance of the application. This parameter is always NULL. If you need to detect whether another instance already exists, create a uniquely named mutex using the CreateMutex function.

So I think this code does not work for modern Windows versions. It should have worked under older versions. See https://stackoverflow.com/questions/7458436/why-does-previnstance-exist-in-winmain-and-wwinmain-if-it-is-always-null

Sorry for spoiling...

The FindWindow / OpenIcon / SetForeGroundWindow is still a useful suggestion (did not test).
Wilko

 6 
 on: March 14, 2019, 07:01:26 AM 
Started by Richard Marchessault - Last post by Klaas Holland
This is the FreeBasic version

Code: [Select]
 
Function FF_WINMAIN ( ByVal hInstance     as HINSTANCE, _
                      ByVal hPrevInstance as HINSTANCE, _
                      ByRef lpCmdLine     as String,    _ 
                      ByVal iCmdShow      as Long       ) as Long

    If FF_PrevInstance Then
        Dim hWin   as Long  =  FindWindow(gFLY_AppID, ByVal 0)
        OpenIcon hWin                                         '-- Activate the first instance
        SetForegroundWindow hWin

        Function = True   
    Else
        Function = False    'return TRUE if you want the program to end.
    End If

End Function

 7 
 on: March 13, 2019, 12:08:33 PM 
Started by Paul Squires - Last post by Josť Roca
Done. The new methods are called SxreenX and ScrenY.

Code: [Select]
' =====================================================================================
' Returns the x-coordinate of the window relative to the screen.
' =====================================================================================
PRIVATE PROPERTY CWindow.ScreenX () AS LONG
   DIM rc AS RECT
   ' // Get the dimensions of the window
   .GetWindowRect(m_hwnd, @rc)
   ' // Convert the coordinates to be relative to the parent
   .MapWindowPoints(HWND_DESKTOP, GetParent(m_hwnd), CAST(POINT PTR, @rc), 2)
   ' // Divide by m_rx to make the result High DPI aware
   PROPERTY = rc.Left / m_rx
END PROPERTY
' =====================================================================================

' =====================================================================================
' Returns the y-coordinate of the window relative to the screen.
' =====================================================================================
PRIVATE PROPERTY CWindow.ScreenY () AS LONG
   DIM rc AS RECT
   ' // Get the dimensions of the window
   .GetWindowRect(m_hwnd, @rc)
   ' // Convert the coordinates to be relative to the parent
   .MapWindowPoints(HWND_DESKTOP, GetParent(m_hwnd), CAST(POINT PTR, @rc), 2)
   ' // Divide by m_ry to make the result High DPI aware
   PROPERTY = rc.Top / m_ry
END PROPERTY
' =====================================================================================

 8 
 on: March 13, 2019, 10:10:48 AM 
Started by Paul Squires - Last post by Paul Squires
...and I have already had to make changes to the visual designer WinFormsX code generation to modify the pixels returned by properties such as left, top, width, height to ensure that the value returned has been adjusted to account for the dpi resolution.

 9 
 on: March 13, 2019, 09:12:23 AM 
Started by Paul Squires - Last post by Paul Squires
Hi Jose,

Just curious... should there be a "Left", "Top", properties for the CWindow class? We have properties like Height, Width, ClientWidth, ClientHeight, but nothing related to location of the window or child control? I have been using AfxGetWindowLocation but, as you know, that returns the raw pixel location not adjusted for the DPI setting. For consistency, should you add such properties to retrieve location of the form and/or child controls? Obviously I can build it into my winformsx classes but it makes more sense to have it in the CWindow base class?
 

 10 
 on: March 13, 2019, 08:55:41 AM 
Started by Paul Squires - Last post by Paul Squires
I have to create a small application for my work and am going to use SQLite for the database. This should allow me to properly test you classes.

Writing this application for work is allowing me to find usability issues with the visual designer. It is turning out to be a good exercise and should help accelerate the completion of the visual designer development....although... I am heading to Jamaica all next week :) :) :)]

Pages: [1] 2 3 ... 10