Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to spawn a process with CREATE_NO_WINDOW on windows #245

Merged
merged 3 commits into from
Oct 23, 2023

Conversation

da-liii
Copy link
Contributor

@da-liii da-liii commented Oct 19, 2023

close #244

In most cases, the spawned process is console app without UI. That's why I set the CREATE_NO_WINDOW flag directly.

@da-liii
Copy link
Contributor Author

da-liii commented Oct 19, 2023

https://github.com/tboox/tbox/blob/master/src/tbox/platform/process.h#L41
看了这个的选项,如果是要加一个flag的话,应该需要新增一个enum。我觉得这里直接 NO_WINDOW就可以了,暂时不需要加选项。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


https://github.com/tboox/tbox/blob/master/src/tbox/platform/process.h#L41
After looking at this option, if you want to add a flag, you should add a new enum. I think NO_WINDOW is enough here, and there is no need to add options for the time being.

@da-liii da-liii marked this pull request as draft October 20, 2023 07:17
@da-liii da-liii changed the title Spawn a process with CREATE_NO_WINDOW on windows Option to spawn a process with CREATE_NO_WINDOW on windows Oct 23, 2023
@da-liii da-liii requested a review from waruqi October 23, 2023 02:42
@da-liii da-liii marked this pull request as ready for review October 23, 2023 02:42
@@ -43,6 +43,7 @@ typedef enum __tb_process_flag_e
TB_PROCESS_FLAG_NONE = 0
, TB_PROCESS_FLAG_SUSPEND = 1 //!< suspend process
, TB_PROCESS_FLAG_DETACH = 2 //!< all subprocesses will be exited when the parent process is exited (ctrl+c or onexit) if this flag is not setted
, TB_PROCESS_FLAG_NO_WINDOW = 4 //!< avoid to launch the console
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释可以再写详细点,如果仅仅只对 windows 有效,最好提下,如果其他平台也支持,那就一并处理下

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个仅仅对windows有效,因为别的平台不需要处理这个问题

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那也可以提下,主要用于处理 win 下的问题

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更新

@da-liii da-liii requested a review from waruqi October 23, 2023 13:24
@waruqi waruqi merged commit 01bbf59 into tboox:dev Oct 23, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants