NO

Recent Posts

Pages: 1 ... 8 9 [10]
91
General discussions / Re: miniz 3.0.2
« Last post by Vortex on October 22, 2024, 09:50:38 AM »
Msys2 can compile the code. It creates a library named libzip.a
92
General discussions / Re: miniz 3.0.2
« Last post by John Z on October 21, 2024, 11:53:45 PM »
Thanks Timo, appreciate the look see.

Not urgent anyway so I’ll keep looking as time and interest permits.
Appreciate the defines tip.

There are certainly a lot more interesting things these days  :)

John Z
93
General discussions / Re: miniz 3.0.2
« Last post by TimoVJL on October 21, 2024, 08:33:03 PM »
Can't help   :(

internal error comes with x64

Pelles C: with C11
Code: [Select]
struct tm * localtime_s(const time_t * restrict timer, struct tm * restrict dst);
msvc:
Code: [Select]
errno_t localtime_s(struct tm* const tmDest, time_t const* const sourceTime);
so have to define _POSIX_C_SOURCE

My test defines for x86 was: _POSIX_C_SOURCE _wstat64=_wstat _stat64=_stat __stat64=_stat _chsize_s=chsize
x64 have stat64 and wstat64 in crt64

low interest to split source for testing  :(


EDIT:
test with:
Code: [Select]
//#define MINIZ_HEADER_FILE_ONLY // OK
#define MINIZ_NO_ARCHIVE_APIS
#define MINIZ_NO_ARCHIVE_WRITING_APIS
#define MINIZ_NO_STDIO
#define MINIZ_NO_TIME
#define MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
#define MINIZ_NO_INFLATE_APIS
#define MINIZ_NO_MALLOC
#define MINIZ_UNALIGNED_USE_MEMCPY
#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES
//#define MINIZ_NO_DEFLATE_APIS // fatal error inside this code
#include "miniz.h"
errors
Code: [Select]
Building test_1.obj.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(689): error #1021: Invalid operand '&&' in preprocessor expression.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(689): error #1019: Syntax error in preprocessor expression.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(2957): error #1021: Invalid operand '&&' in preprocessor expression.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(2957): error #1019: Syntax error in preprocessor expression.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(3261): error #1019: Syntax error in preprocessor expression.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(3385): error #1021: Invalid operand '&&' in preprocessor expression.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(3385): error #1019: Syntax error in preprocessor expression.
fatal error: Internal error: 'Access violation' at 0x000000013f703e99.
*** Error code: 1 ***
Done.

so split code to header miniz.h miniz_tdef.c and miniz_tinfl.c for using it

split code from
MINIZ_NO_ARCHIVE_APIS
MINIZ_NO_ARCHIVE_WRITING_APIS

this was one problem, that need modification
Code: [Select]
#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
static void mz_zip_time_t_to_dos_time(MZ_TIME_T time, mz_uint16 *pDOS_time,
                                      mz_uint16 *pDOS_date) {
#ifdef __POCC__
  struct tm *tm = localtime(&time);
#elif_MSC_VER
  struct tm tm_struct;
  struct tm *tm = &tm_struct;
  errno_t err = localtime_s(tm, &time);
  if (err) {
    *pDOS_date = 0;
    *pDOS_time = 0;
    return;
  }
#else
  struct tm *tm = localtime(&time);
#endif /* #ifdef _MSC_VER */

EDIT:
compiler crash in function
Code: [Select]
static mz_bool tdefl_compress_normal(
94
General discussions / miniz 3.0.2
« Last post by John Z on October 21, 2024, 12:45:57 PM »
A couple years ago (4?) I hacked miniz 1.19 to get it to run under Pelles C.  It still works under Pelles V12 even with the abundant warnings...

Now I see miniz 3.0.2 is out there.  Tried some quick changes as I made in 1.19 but getting:
fatal error: Internal error: 'Access violation' at 0x00007ff7f5333e99  when compiling with Pelles C 12

https://github.com/kuba--/zip

Would be nice if someone has already got it working :) ?? hope hope hope --

John Z
95
Windows questions / Re: SendInput on a remote process?
« Last post by tony74 on October 20, 2024, 07:42:04 PM »
I've since changed my thinking on this because of the way this particular external program works.
Here's why:
 
When run, the external program in question processes any files it finds in it's 'files' directory.
After having processed it's files, the program *doesn't exit*, in case the user has other chores for it.

There would be no guaranteed way for me to know when it had completed file-processing.
The 'files' folder remains untouched, no way to monitor any changes there.
No indication of processing-progress that I can access.
The user may want to use it for other functions before exiting.

In this case, spawning the program via CreateProcess, letting the user interact with it, exit it, and continuing when CreateProcess returns (WaitForSingleObject) , seems the most sensible approach.

 As much as I would have liked to have made this a seamless process for the user, I can see that abrogating user-control of the spawned process should be avoided in this case.

@John Z : good advice on  WaitForInputIdle, will definitely use it. Thanks!
I normally use CreateProcess, I went with ShellExecute earlier to emulate user-desktop click.
WinSpy didn't return any control handles (all 0). Otherwise, it worked as usual.

@MrBCX: MySendkeys() is very cool! A lot better than the MS example I used. Thanks!




96
Assembly discussions / Batch build file creator
« Last post by Vortex on October 20, 2024, 11:20:43 AM »
Hello,

Here is a simple batch build file creator for 32-bit projects.

Code: [Select]
Usage : MakeBat srcfile.asm [subsystem]
Subsystem is cons or gui

Let's assume that we would like to create a batch file to assemble Test.asm , a console application project :

Code: [Select]
MakeBat.exe Test.asm cons
Output Build.bat :

Code: [Select]
\PellesC\bin\poasm /AIA32 Test.asm
\PellesC\bin\polink /SUBSYSTEM:CONSOLE Test.obj

97
Windows questions / Re: SendInput on a remote process?
« Last post by John Z on October 19, 2024, 02:11:37 AM »
For CreateProcess you will want to pay attention to this from MS docs

“ The calling thread can use the WaitForInputIdle function to wait until the new process has finished its initialization and is waiting for user input with no input pending. This can be useful for synchronization between parent and child processes, because CreateProcess returns without waiting for the new process to finish its initialization. For example, the creating process would use WaitForInputIdle before trying to find a window associated with the new process.”

John Z
98
Windows questions / Re: SendInput on a remote process?
« Last post by John Z on October 18, 2024, 05:00:07 PM »
Hi tony74,

I've also used SendInput on occasion.  It stuffs the keyboard but does not change focus to any other window.  It is important that the window you want to communicate with has the current focus SetFocus(some HWND), without that it probably is not monitoring the keyboard because without focus the keys are meant for some other window.

Also there can be issue with process security levels, MS says "This function fails when it is blocked by UIPI. Note that neither GetLastError nor the return value will indicate the failure was caused by UIPI blocking."  So if QT is as admin and your process is lower it will fail too.

Is this 'QT' program generally available? 

You might try CreateProcess rather than ShellExecute which can have issues with COM processes - or maybe add
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE) to your code just in case, and ShellExecute ensures running at the same security level.

Your comment about WinSpy is curious - it didn't work at all?

John Z
99
Windows questions / Re: SendInput on a remote process?
« Last post by tony74 on October 18, 2024, 04:05:50 AM »
Well, to update, it looks like this is a QT window, so the qwidgit wrapper and 'signals' might throw a new wrinkle into the mix.
I'll try enumerating child windows of the child window tomorrow and see what happens.

WinSpy didn't come up with anything for controls, so we'll see.
And, yeah, these queries have to happen live for each start because handles change every run, which is expected.
100
Windows questions / Re: SendInput on a remote process?
« Last post by tony74 on October 17, 2024, 11:26:57 PM »
@MrBCX

The example differs a bit from my use-case.

The program I'm using launches an external program through ShellExecute.
ShellExecute, rather than CreateProcess, is used so the call, as much as possible, emulates a user having called the external from Explorer or the desktop.

The external program does have focus upon execution, as far as I know.
Now that the external is up and running, my program attempts to sendkeys, but I don't know that in sending the keys, the focus doesn't change back to my program rather than the external?

In any case, the keys don't get through to the intended external.

I enumerated the windows and got a handle for the child-window that has the checkbox and start button I need to click.
I haven't yet, but I could setfocus on the retrieved window handle, just to be sure, but what then?

I could sendmessage, but I still haven't found the two control handles I need. Would winSpy be the next step?
Would those handles or ID change if run from another machine?

So many questions, I know. Just looking for a way-in at the moment, trying not to go 'off the rails' following a wrong path.

Thanks to both of you for having a look.
Pages: 1 ... 8 9 [10]